# 1 "scheduler_slave.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "scheduler_slave.c"
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 1 3 4
# 32 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 1 3 4
# 35 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_config.h" 1 3 4
# 36 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 2 3 4

# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_arch_features.h" 1 3 4
# 38 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 2 3 4
# 356 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/cdefs.h" 1 3 4
# 357 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/features.h" 2 3 4
# 33 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 2 3 4
# 51 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4




# 54 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4
extern void __assert (const char *, const char *, int, const char *);


# 2 "scheduler_slave.c" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stdarg.h" 1 3 4
# 43 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 105 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 3 "scheduler_slave.c" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 1 3 4
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4








# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 214 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 40 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 2 3 4



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 1 3 4
# 38 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_clk_tck.h" 1 3 4
# 39 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 2 3 4




# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 1 3 4
# 28 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/wordsize.h" 1 3 4
# 29 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 32 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 2 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/kernel_types.h" 1 3 4
# 10 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/kernel_types.h" 3 4
typedef unsigned int __kernel_dev_t;
typedef unsigned int __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef unsigned int __kernel_nlink_t;
typedef long __kernel_off_t;
typedef long __kernel_loff_t;
typedef int __kernel_pid_t;
typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
typedef unsigned long __kernel_size_t;
typedef long __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;
typedef long __kernel_clock_t;
typedef int __kernel_daddr_t;
typedef char * __kernel_caddr_t;
typedef unsigned long __kernel_sigset_t;
typedef unsigned short __kernel_uid16_t;
typedef unsigned short __kernel_gid16_t;
typedef __kernel_uid_t __kernel_old_uid_t;
typedef __kernel_gid_t __kernel_old_gid_t;
typedef __kernel_uid_t __kernel_uid32_t;
typedef __kernel_gid_t __kernel_gid32_t;
typedef __kernel_dev_t __kernel_old_dev_t;

typedef struct {
 int val[2];
} __kernel_fsid_t;
# 33 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 2 3 4


typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;


typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;

typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;







typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
# 135 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/typesizes.h" 1 3 4
# 136 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/types.h" 2 3 4


typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;

typedef int __daddr_t;
typedef long int __swblk_t;
typedef int __key_t;


typedef int __clockid_t;


typedef void * __timer_t;


typedef unsigned int __blksize_t;




typedef unsigned int __blkcnt_t;
typedef unsigned long int __blkcnt64_t;


typedef int __fsblkcnt_t;
typedef long int __fsblkcnt64_t;


typedef unsigned int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;

typedef long int __ssize_t;



typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


typedef long int __intptr_t;


typedef unsigned int __socklen_t;





typedef __kernel_ipc_pid_t __ipc_pid_t;
# 44 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 2 3 4
# 44 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 2 3 4
# 59 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4


typedef __clock_t clock_t;



# 75 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4


typedef __time_t time_t;



# 93 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4
typedef __clockid_t clockid_t;
# 105 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4
typedef __timer_t timer_t;
# 121 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4
struct timespec
  {
    __time_t tv_sec;
    long int tv_nsec;
  };








struct tm
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
# 155 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4
};








struct itimerspec
  {
    struct timespec it_interval;
    struct timespec it_value;
  };


struct sigevent;
# 183 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4



extern clock_t clock (void) __attribute__ ((__nothrow__));


extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));



extern double difftime (time_t __time1, time_t __time0)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__));



extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));





extern size_t strftime (char *__restrict __s, size_t __maxsize,
   __const char *__restrict __format,
   __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));

# 235 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4



extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));



extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));





extern struct tm *gmtime_r (__const time_t *__restrict __timer,
       struct tm *__restrict __tp) __attribute__ ((__nothrow__));



extern struct tm *localtime_r (__const time_t *__restrict __timer,
          struct tm *__restrict __tp) __attribute__ ((__nothrow__));





extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));


extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));







extern char *asctime_r (__const struct tm *__restrict __tp,
   char *__restrict __buf) __attribute__ ((__nothrow__));


extern char *ctime_r (__const time_t *__restrict __timer,
        char *__restrict __buf) __attribute__ ((__nothrow__));






extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;





extern char *tzname[2];



extern void tzset (void) __attribute__ ((__nothrow__));



extern int daylight;
extern long int timezone;





extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
# 321 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));


extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));


extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
# 433 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/time.h" 3 4

# 4 "scheduler_slave.c" 2

# 1 "aceMesh_clang.h" 1


# 1 "aceMesh_task.h" 1







# 1 "task.h" 1


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 152 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 326 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
typedef int wchar_t;
# 423 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
typedef struct {
  long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
  long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
# 434 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
} max_align_t;
# 4 "task.h" 2



# 1 "hashtable.h" 1


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stdbool.h" 1 3 4
# 4 "hashtable.h" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 1 3 4
# 30 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4




# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 35 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 2 3 4
# 44 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4


typedef struct __STDIO_FILE_STRUCT FILE;





# 62 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
typedef struct __STDIO_FILE_STRUCT __FILE;
# 72 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 1 3 4
# 81 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 82 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 2 3 4





# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/wchar.h" 1 3 4
# 52 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/wchar.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 355 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 53 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/wchar.h" 2 3 4

# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/wchar.h" 1 3 4
# 55 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/wchar.h" 2 3 4
# 81 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/wchar.h" 3 4
typedef struct
{
 wchar_t __mask;
 wchar_t __wc;
} __mbstate_t;
# 88 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 2 3 4
# 119 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_mutex.h" 1 3 4
# 120 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 2 3 4
# 170 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
typedef struct {
 __off_t __pos;

 __mbstate_t __mbstate;


 int __mblen_pending;

} __STDIO_fpos_t;


typedef struct {
 __off64_t __pos;

 __mbstate_t __mbstate;


 int __mblen_pending;

} __STDIO_fpos64_t;




typedef __off64_t __offmax_t;







typedef __ssize_t __io_read_fn(void *__cookie, char *__buf, size_t __bufsize);
typedef __ssize_t __io_write_fn(void *__cookie,
     __const char *__buf, size_t __bufsize);




typedef int __io_seek_fn(void *__cookie, __offmax_t *__pos, int __whence);
typedef int __io_close_fn(void *__cookie);

typedef struct {
 __io_read_fn *read;
 __io_write_fn *write;
 __io_seek_fn *seek;
 __io_close_fn *close;
} _IO_cookie_io_functions_t;
# 233 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
struct __STDIO_FILE_STRUCT {
 unsigned short __modeflags;


 unsigned char __ungot_width[2];






 int __filedes;

 unsigned char *__bufstart;
 unsigned char *__bufend;
 unsigned char *__bufpos;
 unsigned char *__bufread;
# 261 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
 struct __STDIO_FILE_STRUCT *__nextopen;


 void *__cookie;
 _IO_cookie_io_functions_t __gcs;


 wchar_t __ungot[2];


 __mbstate_t __state;
# 284 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
};
# 388 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/uClibc_stdio.h" 3 4
extern int __fgetc_unlocked(FILE *__stream);
extern int __fputc_unlocked(int __c, FILE *__stream);
# 73 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 2 3 4










typedef __STDIO_fpos64_t fpos_t;



typedef __STDIO_fpos64_t fpos64_t;
# 131 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/stdio_lim.h" 1 3 4
# 132 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 2 3 4
# 144 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern __thread FILE *_slave_stdin;
extern __thread FILE *_slave_stdout;
extern __thread FILE *_slave_stderr;
# 158 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4


extern int remove (__const char *__filename) __attribute__ ((__nothrow__));

extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));




# 175 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern FILE *tmpfile (void) __asm__ ("" "tmpfile64") ;






extern FILE *tmpfile64 (void) ;



extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;





extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
# 204 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern char *tempnam (__const char *__dir, __const char *__pfx)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;








extern int fclose (FILE *__stream);




extern int fflush (FILE *__stream);

# 229 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 243 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4

# 260 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("" "fopen64")

  ;
extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64")


  ;







extern FILE *fopen64 (__const char *__restrict __filename,
        __const char *__restrict __modes) ;
extern FILE *freopen64 (__const char *__restrict __filename,
   __const char *__restrict __modes,
   FILE *__restrict __stream) ;




extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
# 307 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4



extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) __attribute__ ((__nothrow__));





extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
         size_t __size) __attribute__ ((__nothrow__));


extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));








extern int fprintf (FILE *__restrict __stream,
      __const char *__restrict __format, ...);




extern int printf (__const char *__restrict __format, ...);

extern int sprintf (char *__restrict __s,
      __const char *__restrict __format, ...) __attribute__ ((__nothrow__));





extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg);




extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);

extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
       __gnuc_va_list __arg) __attribute__ ((__nothrow__));





extern int snprintf (char *__restrict __s, size_t __maxlen,
       __const char *__restrict __format, ...)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));

extern int vsnprintf (char *__restrict __s, size_t __maxlen,
        __const char *__restrict __format, __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));

# 403 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4





extern int fscanf (FILE *__restrict __stream,
     __const char *__restrict __format, ...) ;




extern int scanf (__const char *__restrict __format, ...) ;

extern int sscanf (__const char *__restrict __s,
     __const char *__restrict __format, ...) __attribute__ ((__nothrow__));








extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
      __gnuc_va_list __arg)
     __attribute__ ((__format__ (__scanf__, 2, 0))) ;





extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
     __attribute__ ((__format__ (__scanf__, 1, 0))) ;


extern int vsscanf (__const char *__restrict __s,
      __const char *__restrict __format, __gnuc_va_list __arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));









extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);





extern int getchar (void);

# 469 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 483 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);











extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);





extern int putchar (int __c);

# 516 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);







extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
# 535 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int getw (FILE *__stream);


extern int putw (int __w, FILE *__stream);








extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     ;






extern char *gets (char *__s) ;

# 602 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4





extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);





extern int puts (__const char *__s);






extern int ungetc (int __c, FILE *__stream);






extern size_t fread (void *__restrict __ptr, size_t __size,
       size_t __n, FILE *__restrict __stream) ;




extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
        size_t __n, FILE *__restrict __s) ;

# 655 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
         size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
          size_t __n, FILE *__restrict __stream) ;








extern int fseek (FILE *__stream, long int __off, int __whence);




extern long int ftell (FILE *__stream) ;




extern void rewind (FILE *__stream);

# 710 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4

# 724 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64")
                                          ;
extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("" "fsetpos64")
                                                            ;








extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) ;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);




extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));

extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;

extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;




extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;








extern void perror (__const char *__s);






extern int sys_nerr;
extern __const char *__const sys_errlist[];






extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;




extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
# 794 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern FILE *popen (__const char *__command, __const char *__modes) ;





extern int pclose (FILE *__stream);





extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
# 834 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4
extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));



extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;


extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
# 896 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdio.h" 3 4

# 5 "hashtable.h" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 1 3 4
# 35 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 36 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 2 3 4


# 98 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;







__extension__ typedef struct
  {
    long long int quot;
    long long int rem;
  } lldiv_t;


# 147 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern size_t _stdlib_mb_cur_max (void) __attribute__ ((__nothrow__)) ;






extern double atof (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;


extern int atoi (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;

extern long int atol (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;





__extension__ extern long long int atoll (__const char *__nptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;






extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;





extern float strtof (__const char *__restrict __nptr,
       char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern long double strtold (__const char *__restrict __nptr,
       char **__restrict __endptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;






extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




__extension__
extern long long int strtoq (__const char *__restrict __nptr,
        char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

__extension__
extern unsigned long long int strtouq (__const char *__restrict __nptr,
           char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;





__extension__
extern long long int strtoll (__const char *__restrict __nptr,
         char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

__extension__
extern unsigned long long int strtoull (__const char *__restrict __nptr,
     char **__restrict __endptr, int __base)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;

# 297 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;


extern long int a64l (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;




# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 1 3 4
# 29 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4






typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;




typedef __loff_t loff_t;





typedef __ino64_t ino_t;




typedef __ino64_t ino64_t;




typedef __dev_t dev_t;




typedef __gid_t gid_t;




typedef __mode_t mode_t;




typedef __nlink_t nlink_t;




typedef __uid_t uid_t;







typedef __off64_t off_t;




typedef __off64_t off64_t;




typedef __pid_t pid_t;




typedef __id_t id_t;




typedef __ssize_t ssize_t;





typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;





typedef __key_t key_t;
# 147 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 148 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 2 3 4



typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 195 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4
typedef int int8_t __attribute__ ((__mode__ (__QI__)));
typedef int int16_t __attribute__ ((__mode__ (__HI__)));
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
typedef int int64_t __attribute__ ((__mode__ (__DI__)));


typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));

typedef int register_t __attribute__ ((__mode__ (__word__)));
# 217 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/endian.h" 1 3 4
# 37 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/endian.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/endian.h" 1 3 4
# 38 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/endian.h" 2 3 4
# 218 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 1 3 4
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/select.h" 1 3 4
# 32 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigset.h" 1 3 4
# 23 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 35 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 2 3 4



typedef __sigset_t sigset_t;







# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 1 3 4
# 73 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/time.h" 3 4
struct timeval
  {
    __time_t tv_sec;
    __suseconds_t tv_usec;
  };
# 47 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 2 3 4


typedef __suseconds_t suseconds_t;





typedef long int __fd_mask;
# 67 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 3 4
typedef struct
  {






    __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];


  } fd_set;






typedef __fd_mask fd_mask;
# 99 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 3 4

# 109 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
     fd_set *__restrict __writefds,
     fd_set *__restrict __exceptfds,
     struct timeval *__restrict __timeout);
# 128 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/select.h" 3 4

# 221 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/sysmacros.h" 1 3 4
# 29 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/sysmacros.h" 3 4
__extension__
static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
     __attribute__ ((__nothrow__));
__extension__
static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
       unsigned int __minor)
     __attribute__ ((__nothrow__));


__extension__ static __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
{
  return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
}

__extension__ static __inline unsigned int
__attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
{
  return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
}

__extension__ static __inline unsigned long long int
__attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
{
  return ((__minor & 0xff) | ((__major & 0xfff) << 8)
   | (((unsigned long long int) (__minor & ~0xff)) << 12)
   | (((unsigned long long int) (__major & ~0xfff)) << 32));
}
# 224 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 2 3 4
# 248 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4
typedef __blkcnt64_t blkcnt_t;



typedef __fsblkcnt64_t fsblkcnt_t;



typedef __fsfilcnt64_t fsfilcnt_t;





typedef __blkcnt64_t blkcnt64_t;
typedef __fsblkcnt64_t fsblkcnt64_t;
typedef __fsfilcnt64_t fsfilcnt64_t;
# 273 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/types.h" 3 4

# 307 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 2 3 4






extern long int random (void) __attribute__ ((__nothrow__));


extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));





extern char *initstate (unsigned int __seed, char *__statebuf,
   size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));



extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));







struct random_data
  {
    int32_t *fptr;
    int32_t *rptr;
    int32_t *state;
    int rand_type;
    int rand_deg;
    int rand_sep;
    int32_t *end_ptr;
  };

extern int random_r (struct random_data *__restrict __buf,
       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int srandom_r (unsigned int __seed, struct random_data *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
   size_t __statelen,
   struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));

extern int setstate_r (char *__restrict __statebuf,
         struct random_data *__restrict __buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));






extern int rand (void) __attribute__ ((__nothrow__));

extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));




extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
# 382 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern double drand48 (void) __attribute__ ((__nothrow__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));



extern long int lrand48 (void) __attribute__ ((__nothrow__));
extern long int nrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern long int mrand48 (void) __attribute__ ((__nothrow__));
extern long int jrand48 (unsigned short int __xsubi[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





struct drand48_data
  {
    unsigned short int __x[3];
    unsigned short int __old_x[3];
    unsigned short int __c;
    unsigned short int __init;
    unsigned long long int __a;
  };



extern int drand48_r (struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));



extern int lrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int mrand48_r (struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
        struct drand48_data *__restrict __buffer,
        long int *__restrict __result)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern int seed48_r (unsigned short int __seed16v[3],
       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern int lcong48_r (unsigned short int __param[7],
        struct drand48_data *__buffer)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));









extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *libc_aligned_malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *libc_set_aligned_malloc (size_t __size,int align) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *libc_uncached_malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;







extern void *realloc (void *__ptr, size_t __size)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));

extern void free (void *__ptr) __attribute__ ((__nothrow__));

extern void libc_aligned_free (void *__ptr) __attribute__ ((__nothrow__));

extern void libc_set_aligned_free (void *__ptr) __attribute__ ((__nothrow__));

extern void libc_uncached_free (void *__ptr) __attribute__ ((__nothrow__));




extern void cfree (void *__ptr) __attribute__ ((__nothrow__));



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/alloca.h" 1 3 4
# 25 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/alloca.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 26 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/alloca.h" 2 3 4







extern void *alloca (size_t __size) __attribute__ ((__nothrow__));








# 497 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 2 3 4




extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
# 510 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4


extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));






extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));






extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));






extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;




extern char *__secure_getenv (__const char *__name)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;





extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));





extern int setenv (__const char *__name, __const char *__value, int __replace)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));


extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));
# 582 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern int clearenv (void) __attribute__ ((__nothrow__));
# 591 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
# 605 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __asm__ ("" "mkstemp64")
     __attribute__ ((__nonnull__ (1))) ;





extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 622 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;








extern int system (__const char *__command) ;

# 651 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern char *realpath (__const char *__restrict __name,
         char *__restrict __resolved) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));






typedef int (*__compar_fn_t) (__const void *, __const void *);









extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar)
     __attribute__ ((__nonnull__ (1, 2, 5))) ;



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));



extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;



__extension__ extern long long int llabs (long long int __x)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;







extern div_t div (int __numer, int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;




__extension__ extern lldiv_t lldiv (long long int __numer,
        long long int __denom)
     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;

# 732 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern char *gcvt (double __value, int __ndigit, char *__buf)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
# 769 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4



extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;


extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     __attribute__ ((__nothrow__));

# 798 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4
extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
# 881 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdlib.h" 3 4

# 6 "hashtable.h" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 1 3 4
# 28 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4





# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 34 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 2 3 4




extern void *memcpy (void *__restrict __dest,
       __const void *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memmove (void *__dest, __const void *__src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));






extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
        int __c, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));





extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern void *memchr (__const void *__s, int __c, size_t __n)
      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 82 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4


extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncpy (char *__restrict __dest,
        __const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
        size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcmp (__const char *__s1, __const char *__s2)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strcoll (__const char *__s1, __const char *__s2)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern size_t strxfrm (char *__restrict __dest,
         __const char *__restrict __src, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

# 130 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern char *strdup (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 165 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4


extern char *strchr (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

extern char *strrchr (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 181 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4



extern size_t strcspn (__const char *__s, __const char *__reject)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern size_t strspn (__const char *__s, __const char *__accept)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strpbrk (__const char *__s, __const char *__accept)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));

extern char *strstr (__const char *__haystack, __const char *__needle)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));



extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

# 212 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
         char **__restrict __save_ptr)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
# 244 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4


extern size_t strlen (__const char *__s)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

# 258 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4


extern char *strerror (int __errnum) __attribute__ ((__nothrow__));

# 285 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));

extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__glibc_strerror_r") __attribute__ ((__nothrow__))

                          __attribute__ ((__nonnull__ (2)));
# 306 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern void bcopy (__const void *__src, void *__dest, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));


extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern char *index (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));


extern char *rindex (__const char *__s, int __c)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 339 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
# 352 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern int strcasecmp (__const char *__s1, __const char *__s2)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));


extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 375 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern char *strsep (char **__restrict __stringp,
       __const char *__restrict __delim)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
# 429 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/string.h" 3 4
extern size_t strlcat(char *__restrict dst, const char *__restrict src,
                      size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
                      size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));



# 7 "hashtable.h" 2





# 11 "hashtable.h"
typedef struct entry {
    void *key;
    void *value;
    struct entry *next;
} *Entry;





typedef struct hashMap *HashMap;
# 45 "hashtable.h"
typedef struct hashMap {
    int size;
    int listSize;


    Entry list;






} *HashMap;


int hashCode(HashMap hashMap, void *key);
int slave_hashCode(HashMap hashMap, void *key);


# 63 "hashtable.h" 3 4
_Bool 
# 63 "hashtable.h"
    hashEqual(void *key1, void *key2);

# 64 "hashtable.h" 3 4
_Bool 
# 64 "hashtable.h"
    slave_hashEqual(void *key1, void *key2);

void hashPut(HashMap hashMap, void *key, void *value);
void slave_hashPut(HashMap hashMap, void *key, void *value);

void *hashGet(HashMap hashMap, void *key);
void *slave_hashGet(HashMap hashMap, void *key);


# 72 "hashtable.h" 3 4
_Bool 
# 72 "hashtable.h"
    hashRemove(HashMap hashMap, void *key);

# 73 "hashtable.h" 3 4
_Bool 
# 73 "hashtable.h"
    slave_hashRemove(HashMap hashMap, void *key);


# 75 "hashtable.h" 3 4
_Bool 
# 75 "hashtable.h"
    hashExists(HashMap hashMap, void *key);

# 76 "hashtable.h" 3 4
_Bool 
# 76 "hashtable.h"
    slave_hashExists(HashMap hashMap, void *key);

void hashClear(HashMap hashMap);
void slave_hashClear(HashMap hashMap);

HashMap createHashMap();
HashMap slave_createHashMap();

void resetHashMap(HashMap hashMap, int listSize);
void slave_resetHashMap(HashMap hashMap, int listSize);

typedef struct hashMapIterator {
    Entry entry;
    int count;
    int hashCode;
    HashMap hashMap;
} *HashMapIterator;




HashMapIterator createHashMapIterator(HashMap hashMap);



# 100 "hashtable.h" 3 4
_Bool 
# 100 "hashtable.h"
    hasNextHashMapIterator(HashMapIterator iterator);


HashMapIterator nextHashMapIterator(HashMapIterator iterator);


void freeHashMapIterator(HashMapIterator *iterator);

HashMapIterator slave_createHashMapIterator(HashMap hashMap);



# 111 "hashtable.h" 3 4
_Bool 
# 111 "hashtable.h"
    slave_hasNextHashMapIterator(HashMapIterator iterator);


HashMapIterator slave_nextHashMapIterator(HashMapIterator iterator);


void slave_freeHashMapIterator(HashMapIterator *iterator);
# 8 "task.h" 2
# 17 "task.h"
typedef int task_type;
# 48 "task.h"
enum task_state {
    ALLOCATED = 0,
    READY,
    RUNNING

};
enum DA_state
{
    INITED = 0,
    SATISFIED,
    USING,
    FINISHED,
    DELETABLE
};
typedef enum __attribute__((__packed__)) {
    NO_ACCESS_TYPE = 0,
    READ_ACCESS_TYPE,
    WRITE_ACCESS_TYPE,
    READWRITE_ACCESS_TYPE,
    CONCURRENT_ACCESS_TYPE,
    COMMUTATIVE_ACCESS_TYPE,
    REDUCTION_ACCESS_TYPE,
    WEAK_ACCESS
} DataAccessType;
# 80 "task.h"
typedef struct BottomMapEntry {
    struct DataAccess *_access;
# 93 "task.h"
} BottomMapEntry;
typedef struct new_slave_table_item {
    void * data_addr;
    struct DataAccess *data_access;
    struct new_slave_table_item * succ;
} new_slave_table_item;

typedef struct new_slave_table {
    int col_idx ;
    struct new_slave_table_item *items;
    struct new_slave_table_item *col_items;



} new_slave_table;
struct DataAccess {



    struct task *_originator;


    struct DataAccess *_successor;
    struct DataAccess *_child;
    int _type __attribute__((aligned(32)));
    int _accessFlags __attribute__((aligned(32)));
    int top __attribute__((aligned(32)));
    int mutex_access __attribute__((aligned(32)));


};
struct TaskDataAccesses {




    struct new_slave_table *_subaccessBottomMap;
    struct DataAccess *_accessArray;
    void **_addressArray;
    size_t _currentIndex;
# 141 "task.h"
};

struct task {
    int ref_count_t;
    int affinity_id;
# 158 "task.h"
    struct task *next;
    struct task *parent;
    int _predecessorCount __attribute__((aligned(32)));
    int _countdownToBeWokenUp __attribute__((aligned(32)));
    struct TaskDataAccesses _dataAccesses;


    int _endExecute;
# 181 "task.h"
};
struct new_slave_table * init_new_slave_table();
struct new_slave_table *slave_init_new_slave_table();
void setparent(struct task *child_task, struct task *t);

struct task *getparent(struct task *t);
void initprecount(struct task *t);
void initialize(struct DataAccess *cur, int type, struct task *originator, int _accessFlags_, int top_);
void initTaskDataAccess(struct task *t, int _size);

struct TaskDataAccesses *getDataAccesses(struct task *t);
struct DataAccess *findAccess(struct task *t, void *address);
void setChild(struct DataAccess *parent, struct DataAccess *child);
void setSuccessor(struct DataAccess *pre, struct DataAccess *successor);
void set_unblock_Successor(struct DataAccess *pre, struct DataAccess *successor);
int predec_count(struct task *t);
int dec_predecessorCount(struct task *t);
int child_count(struct task *t);
int dec_childCount(struct task *t);
int inc_predecessorCount(struct task *t);


void slave_setparent(struct task *child_task, struct task *t);
struct task *slave_getparent(struct task *t);
void slave_initprecount(struct task *t);
void slave_initialize(struct DataAccess *cur, int type, struct task *originator, int _accessFlags_, int top_);
void slave_initTaskDataAccess(struct task *t, int _size);
struct TaskDataAccesses *slave_getDataAccesses(struct task *t);
struct DataAccess *slave_findAccess(struct task *t, void *address);
void slave_setChild(struct DataAccess *parent, struct DataAccess *child);
void slave_setSuccessor(struct DataAccess *pre, struct DataAccess *successor);
void slave_set_unblock_Successor(struct DataAccess *pre, struct DataAccess *successor);
int slave_predec_count(struct task *t);
int slave_dec_predecessorCount(struct task *t);
int slave_child_count(struct task *t);
int slave_dec_childCount(struct task *t);
int slave_inc_predecessorCount(struct task *t);
# 231 "task.h"
void task_constructor(struct task *self);
struct task task_constructor_id(int id);

void slave_task_constructor(struct task *self);

void slave_spawn(struct task *t);
void enqueue(struct task *t);

void adjust_affinity_id(struct task *self, struct task *another_task);
int slave_ref_count(struct task *self);
# 261 "task.h"
int slave_is_stolen_task(struct task *self);

struct empty_task {
    struct task task_base;
};
# 9 "aceMesh_task.h" 2
# 44 "aceMesh_task.h"
typedef struct aceMesh_task
{
    struct task task_base;
# 55 "aceMesh_task.h"
    int loop_id;
    int task_id;






    int capacity_addrs;
    struct task **successor_tasks;
    int successor_count;
    struct task* vertical_task;
    task_type my_type;
    struct aceMesh_task * last_successor;
# 77 "aceMesh_task.h"
    int suspend;

}aceMesh_task;

int get_loop_id(struct aceMesh_task* self);

int get_task_id(struct aceMesh_task* self);
# 116 "aceMesh_task.h"
struct task *slave_execute(struct aceMesh_task *self);
struct task *execute(struct aceMesh_task *self);


task_type get_task_type(struct aceMesh_task* self);

int get_total_successor_sum(struct aceMesh_task* self);
# 4 "aceMesh_clang.h" 2
# 1 "aceMesh_runtime.h" 1
# 11 "aceMesh_runtime.h"
# 1 "am_machine.h" 1
# 17 "am_machine.h"
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread.h" 1 3 4
# 18 "am_machine.h" 2
# 12 "aceMesh_runtime.h" 2


# 1 "MemPool.h" 1



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 1 3 4
# 44 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 45 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 2 3 4
# 110 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 3 4

# 110 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 3 4
extern void * malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));


extern void * calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__))
       __attribute__ ((__malloc__));



extern void * realloc (void * __ptr, size_t __size) __attribute__ ((__nothrow__))

       __attribute__ ((__malloc__));


extern void free (void * __ptr) __attribute__ ((__nothrow__));


extern void * memalign (size_t __alignment, size_t __size) __attribute__ ((__nothrow__));


extern void * valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
# 191 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/malloc.h" 3 4
extern void *__uc_malloc(size_t size);
extern void (*__uc_malloc_failed)(size_t size);
# 5 "MemPool.h" 2




# 8 "MemPool.h"
typedef struct block {
    void *data;
    struct block *next;
} block;
typedef struct MemPool {
    void *EndBlock;
    void *self1;
    struct block *AllocatedMemBlock;
    struct block *FreeMemBlock;
} MemPool;

struct block *mempool_allocblock(struct MemPool pool);

void InitPool();
void *acemesh_myalloc_aligned_4(int datasize);
void *acemesh_myalloc_aligned_8(int datasize);
void *acemesh_myalloc_aligned_16(int datasize);
void *acemesh_myalloc_aligned_32(int datasize);
void *acemesh_myalloc_aligned_64(int datasize);
void ReInitial();
void FreePool();

void slave_initpool();
void *slave_my_malloc_aligned(int size);

void my_free_aligned(void *self);
void slave_my_free_aligned(void *self);
void *slave_acemesh_myalloc_aligned_64(int datasize, int _myid);
void *slave_acemesh_myalloc_aligned_16(int datasize, int myid);
void slave_InitPool(int _myid);
void slave_ReInitial(int _myid);
void slave_FreePool(int _myid);
struct block *slave_mempool_allocblock(struct MemPool slave_pool);
# 15 "aceMesh_runtime.h" 2
# 30 "aceMesh_runtime.h"
typedef int Error_Code;
# 56 "aceMesh_runtime.h"
Error_Code aceMesh_runtime_init_TNum(int thread_num);
Error_Code aceMesh_runtime_init(int thread_num, int core_ids[]);
Error_Code aceMesh_runtime_init_zeroPara();
Error_Code aceMesh_runtime_shutdown();
Error_Code aceMesh_runtime_shutdown_with_proc_id(int proc_id);
# 103 "aceMesh_runtime.h"
Error_Code register_task(struct aceMesh_task *t, int n, ...);
Error_Code register_task_datainfo(struct aceMesh_task *t, int n, double *ad, int area, int nei,
                                  int ty, int ne);
Error_Code register_task_end(struct aceMesh_task *t);
# 117 "aceMesh_runtime.h"
void spawn_and_goout(void *taskptr);
# 130 "aceMesh_runtime.h"
Error_Code begin_split_task_charPara(char *loop_info, void *taskptr);
Error_Code begin_split_task_zeroPara(void *taskptr);
Error_Code end_split_task_zeroPara(void *taskptr);

void spawn_and_wait_zeroPara(void *taskptr);
void spawn_and_wait(int print_graph, void *taskptr);





extern int num_registers;

int aceMesh_get_thread_id();
void aceMesh_MPI_rank(int rank);
void acemesh_noop_touch_integer(int *data);
void acemesh_noop_touch_real(double *data);


void print_to_thread_file(const char *format, ...);
# 181 "aceMesh_runtime.h"
typedef void (*TASK_FUNCPTR)(volatile void *args);

typedef void (*NEIGHBOR_FUNCPTR)(void **neighbor_addrs, int *num_neigh, void *args);




void acemesh_runtime_init(int total_threads);
void acemesh_runtime_shutdown();

void acemesh_task_generator(void *taskfptr, void *args, unsigned int args_size);
void acemesh_task_generator_with_neighbors(void *taskfptr, void *args, unsigned int args_size,
                                           void *cxx_this_pointer, void *get_neighbors_funcptr,
                                           void *neighbor_args);

void acemesh_composite_task_generator(void *taskfptr, void *args, unsigned int args_size);
void acemesh_composite_task_generator_with_neighbors(void *taskfptr, void *args,
                                                     unsigned int args_size, void *cxx_this_pointer,
                                                     void *get_neighbors_funcptr,
                                                     void *neighbor_args);


void acemesh_push_wrlist(int argc, void *addr, int access_flag, ...);
void acemesh_push_rlist(int argc, void *addr, int access_flag, ...);
void acemesh_push_wlist(int argc, void *addr, int access_flag, ...);

void slave_acemesh_push_wrlist(int argc, void *addr, int access_flag, ...);
void slave_acemesh_push_rlist(int argc, void *addr, int access_flag, ...);
void slave_acemesh_push_wlist(int argc, void *addr, int access_flag, ...);
void slave_acemesh_task_generator(void *taskfptr, void *args, unsigned int args_size);
void slave_acemesh_task_generator_with_neighbors(void *taskfptr, void *args, unsigned int args_size,
                                                 void *cxx_this_pointer,
                                                 void *get_neighbors_funcptr, void *neighbor_args);







void acemesh_begin_split_task(char *loop_info);
void acemesh_end_split_task();
void acemesh_spawn_and_wait(int print_graph);

void *acemesh_malloc_obj(unsigned int args_size);

void acemesh_task_map_master();
void acemesh_set_suspend(int mode);
void acemesh_task_set_type(int type);





void *aceMesh_get_data();
void aceMesh_set_data(void *data);
int get_part_id();
void set_part_id(int part_id);
# 5 "aceMesh_clang.h" 2
# 1 "ci_task.h" 1
# 13 "ci_task.h"
typedef struct ci_task {
    struct aceMesh_task aceMesh_task_base;
    void *ci_args;



    TASK_FUNCPTR slave_ci_task_func;
    void *ci_cxx_this_pointer;
    void *ci_get_neighbors;
    void *ci_neighbor_args;
    int neighbor_isdefine;
} ci_task;




void ci_task_constructor(ci_task *self, TASK_FUNCPTR funcptr);
void ci_task_destructor(ci_task *p_ci_task);
void define(ci_task *self, void *a_args, unsigned int args_size);
void define_neighbors(ci_task *self, void *cxx_this_pointer, void *a_get_neighbors,
                      void *a_neighbor_args);


void get_neighbor(ci_task *self, void **neighbor_addrs, int *num_neigh);
void slave_ci_task_constructor(ci_task *self, TASK_FUNCPTR funcptr);
void slave_ci_task_destructor(ci_task *p_ci_task);
void slave_define(ci_task *self, void *a_args, unsigned int args_size);
void slave_define_neighbors(ci_task *self, void *cxx_this_pointer, void *a_get_neighbors,
                            void *a_neighbor_args);


void slave_get_neighbor(ci_task *self, void **neighbor_addrs,
                        int *num_neigh);
# 6 "aceMesh_clang.h" 2
# 16 "aceMesh_clang.h"
void get_neighbor(ci_task* self,void** neighbor_addrs, int *num_neigh);
# 39 "aceMesh_clang.h"
extern void ci_task_destructor(ci_task* p_ci_task);
# 6 "scheduler_slave.c" 2
# 1 "aceMesh_stack.h" 1





struct concurrent_aceMesh_stack
{




    struct task* task_pool;

    volatile int my_lock;
};
# 26 "aceMesh_stack.h"
struct aceMesh_stack {
  struct task* task_pool;
};


void push(struct concurrent_aceMesh_stack* self,struct task* t);
void init_push(struct concurrent_aceMesh_stack* self,struct task* t);
int try_pop(struct concurrent_aceMesh_stack* self,struct task** t);




void slave_push(struct concurrent_aceMesh_stack* self,struct task* t);
int slave_try_pop(struct concurrent_aceMesh_stack* self, struct task** t);
# 138 "aceMesh_stack.h"
struct aceMesh_queue
{
    struct task* head;
    struct task* tail;
};

void q_push(struct aceMesh_queue* self ,struct task* t);
int try_q_pop(struct aceMesh_queue* self, struct task* t);
# 7 "scheduler_slave.c" 2

# 1 "aceMesh_utils.h" 1



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/lib/gcc/sw_64sw6a-sunway-linux-gnu/7.1.0/include/stddef.h" 1 3 4
# 5 "aceMesh_utils.h" 2



long long tick_count_now();

unsigned long rpcc();
unsigned long rtc();
# 21 "aceMesh_utils.h"
unsigned GetPrime(unsigned seed);
# 118 "aceMesh_utils.h"
void my_mutex_lock(volatile int *my_lock);
void my_mutex_unlock(volatile int *my_lock);




void slave_my_mutex_lock(volatile int *my_lock);
void slave_my_mutex_unlock(volatile int *my_lock);
# 9 "scheduler_slave.c" 2
# 1 "args.h" 1
# 61 "args.h"
typedef struct slave_table_item {
    void *data_addr;
    void *data_access;
    struct slave_table_item *succ;
} slave_table_item;
# 10 "scheduler_slave.c" 2

# 1 "ldm_privatequeue.h" 1



# 1 "am_assert.h" 1


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 1 3 4
# 51 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4




# 54 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4
extern void __assert (const char *, const char *, int, const char *);


# 4 "am_assert.h" 2
# 5 "ldm_privatequeue.h" 2
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 1 3 4



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 1 3 4
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigset.h" 1 3 4
# 103 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigset.h" 3 4
extern int __sigismember (__const __sigset_t *, int);
extern int __sigaddset (__sigset_t *, int);
extern int __sigdelset (__sigset_t *, int);
# 34 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4







typedef __sig_atomic_t sig_atomic_t;

# 58 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/signum.h" 1 3 4
# 59 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4
# 75 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
typedef void (*__sighandler_t) (int);
# 91 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4


extern __sighandler_t signal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__));
# 105 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4

# 118 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__));






extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__));




extern int raise (int __sig) __attribute__ ((__nothrow__));




extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
     __attribute__ ((__nothrow__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__));




extern void psignal (int __sig, __const char *__s);
# 154 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int __sigpause (int __sig_or_mask, int __is_sig);
# 179 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));


extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));


extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
# 199 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
typedef __sighandler_t sig_t;
# 210 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/siginfo.h" 1 3 4
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/siginfo.h" 3 4
typedef union sigval
  {
    int sival_int;
    void *sival_ptr;
  } sigval_t;
# 45 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/siginfo.h" 3 4
typedef struct siginfo
  {
    int si_signo;
    int si_errno;

    int si_code;

    union
      {
 int _pad[((128 / sizeof (int)) - 4)];


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
   } _kill;


 struct
   {
     int si_tid;
     int si_overrun;
     sigval_t si_sigval;
   } _timer;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     sigval_t si_sigval;
   } _rt;


 struct
   {
     __pid_t si_pid;
     __uid_t si_uid;
     int si_status;
     __clock_t si_utime;
     __clock_t si_stime;
   } _sigchld;


 struct
   {
     void *si_addr;
   } _sigfault;


 struct
   {
     int si_band;
     int si_fd;
   } _sigpoll;
      } _sifields;
  } siginfo_t;
# 123 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/siginfo.h" 3 4
enum
{
  SI_ASYNCNL = -60,

  SI_TKILL = -6,

  SI_SIGIO,

  SI_ASYNCIO,

  SI_MESGQ,

  SI_TIMER,

  SI_QUEUE,

  SI_USER,

  SI_KERNEL = 0x80

};



enum
{
  ILL_ILLOPC = 1,

  ILL_ILLOPN,

  ILL_ILLADR,

  ILL_ILLTRP,

  ILL_PRVOPC,

  ILL_PRVREG,

  ILL_COPROC,

  ILL_BADSTK

};


enum
{
  FPE_INTDIV = 1,

  FPE_INTOVF,

  FPE_FLTDIV,

  FPE_FLTOVF,

  FPE_FLTUND,

  FPE_FLTRES,

  FPE_FLTINV,

  FPE_FLTSUB

};


enum
{
  SEGV_MAPERR = 1,

  SEGV_ACCERR

};


enum
{
  BUS_ADRALN = 1,

  BUS_ADRERR,

  BUS_OBJERR

};


enum
{
  TRAP_BRKPT = 1,

  TRAP_TRACE

};


enum
{
  CLD_EXITED = 1,

  CLD_KILLED,

  CLD_DUMPED,

  CLD_TRAPPED,

  CLD_STOPPED,

  CLD_CONTINUED

};


enum
{
  POLL_IN = 1,

  POLL_OUT,

  POLL_MSG,

  POLL_ERR,

  POLL_PRI,

  POLL_HUP

};
# 263 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/siginfo.h" 3 4
typedef struct sigevent
  {
    sigval_t sigev_value;
    int sigev_signo;
    int sigev_notify;

    union
      {
 int _pad[((64 / sizeof (int)) - 4)];



 __pid_t _tid;

 struct
   {
     void (*_function) (sigval_t);
     void *_attribute;
   } _sigev_thread;
      } _sigev_un;
  } sigevent_t;






enum
{
  SIGEV_SIGNAL = 0,

  SIGEV_NONE,

  SIGEV_THREAD,


  SIGEV_THREAD_ID = 4

};
# 211 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4



extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));


extern int sigismember (__const sigset_t *__set, int __signo)
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
# 244 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigaction.h" 1 3 4
# 25 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigaction.h" 3 4
struct sigaction
  {


    union
      {

 __sighandler_t sa_handler;

 void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;







    __sigset_t sa_mask;


    unsigned int sa_flags;
  };
# 245 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4


extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
   sigset_t *__restrict __oset) __attribute__ ((__nothrow__));






extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1)));


extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
        struct sigaction *__restrict __oact) __attribute__ ((__nothrow__));


extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));






extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
     __attribute__ ((__nonnull__ (1, 2)));
# 304 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern __const char *__const sys_siglist[65];



struct sigvec
  {
    __sighandler_t sv_handler;
    int sv_mask;

    int sv_flags;

  };
# 328 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int sigvec (int __sig, __const struct sigvec *__vec,
     struct sigvec *__ovec) __attribute__ ((__nothrow__));



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigcontext.h" 1 3 4
# 28 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigcontext.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/sigcontext.h" 1 3 4



struct sigcontext {
# 13 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/sigcontext.h" 3 4
  long sc_onstack;
  long sc_mask;
  long sc_pc;
  long sc_ps;
  long sc_regs[32];
  long sc_ownedfp;
  long sc_fpregs[32];
  unsigned long sc_fpcr;
  unsigned long sc_fp_control;
  unsigned long sc_reserved1, sc_reserved2;
  unsigned long sc_ssize;
  char * sc_sbase;
  unsigned long sc_traparg_a0;
  unsigned long sc_traparg_a1;
  unsigned long sc_traparg_a2;
  unsigned long sc_fp_trap_pc;
  unsigned long sc_fp_trigger_sum;
  unsigned long sc_fp_trigger_inst;
};
# 29 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigcontext.h" 2 3 4
# 334 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4


extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__));
# 346 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__));

# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigstack.h" 1 3 4
# 26 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigstack.h" 3 4
struct sigstack
  {
    void * ss_sp;
    int ss_onstack;
  };



enum
{
  SS_ONSTACK = 1,

  SS_DISABLE

};
# 50 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/sigstack.h" 3 4
typedef struct sigaltstack
  {
    void * ss_sp;
    int ss_flags;
    size_t ss_size;
  } stack_t;
# 349 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 2 3 4
# 357 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
     __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));



extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
   struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__));
# 394 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/signal.h" 3 4
extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__));

extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__));




# 5 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave_intc.h" 1 3 4
# 10 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave_intc.h" 3 4
extern void _Waiting_For_Task();
extern void _MPE_stop();
# 8 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 2 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave_sig.h" 1 3 4
# 9 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 2 3 4


typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned long uint64_t;
# 24 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 3 4
typedef _Float16 float16;






extern int my_printf(const char* ss,...);
# 137 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts2ath.h" 1 3 4

# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 1 3 4
# 11 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 1 3 4
# 30 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/wordsize.h" 1 3 4
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 2 3 4
# 51 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;

typedef unsigned int uint32_t;



typedef unsigned long int uint64_t;
# 68 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;

typedef long int int_least64_t;






typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;

typedef unsigned long int uint_least64_t;
# 93 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef signed char int_fast8_t;

typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 106 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;

typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 122 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef long int intptr_t;


typedef unsigned long int uintptr_t;
# 137 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/stdint.h" 3 4
typedef long int intmax_t;
typedef unsigned long int uintmax_t;
# 12 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 2 3 4
# 27 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
typedef struct CRTS_Proc_info
{
    int32_t rank;
    int32_t size;
    int32_t node_rank;
    int32_t node_size;
    uint8_t mpe_map;

    int32_t jobid;
    int32_t pid;
} CRTS_Proc_info;

typedef struct CRTS_Thrd_info
{
    CRTS_Proc_info pinfo;
    int32_t trank;
    int32_t tsize;
    int16_t node_trank;
    int16_t node_tsize;
    uint64_t spe_map;
    uint8_t row_map;
    uint8_t col_map;
    uint8_t array_trank;
    uint8_t array_tsize;
    int16_t node_spc_trank;
    uint8_t array_spc_trank;

    uint16_t cache_size;
    uint16_t ldm_stack_size;
    uint16_t free_ldm_addr;
    uint16_t free_ldm_size;
    uint16_t shared_mode;
    uint16_t free_shared_ldm_addr;
    uint16_t free_shared_ldm_size;
} CRTS_Thrd_info;

typedef struct CRTS_Cross_info
{
    uint8_t avail;
    uint64_t total;
    uint8_t crts_rsv_avail;
    uint64_t crts_rsv_addr;
    uint8_t msg_rsv_avail;
    uint64_t msg_rsv_addr;
    uint64_t free_addr;
    uint64_t free_size;
} CRTS_Cross_info;

typedef struct CRTS_Custom_lock
{
    int64_t lock;
    int32_t used;
} CRTS_Custom_lock;

typedef struct CRTS_Node_cross
{
    volatile int64_t handup[6];
    volatile int64_t sync[6];

    int64_t slave_sync;
    int64_t slave_lock;
    uint64_t host_lock;
    CRTS_Custom_lock custom_lock[8];
    CRTS_Custom_lock custom_slave_lock[8];
    int32_t custom_lockid;
    int32_t custom_slave_lockid;
} CRTS_Node_cross;

typedef struct CRTS_SIGNAL_INFO
{
  uint64_t src;
  uint64_t size;
  uint64_t dest;
  uint64_t type;
} CRTS_SIGNAL_INFO;
extern CRTS_SIGNAL_INFO crts_signal_info[64];
extern CRTS_Proc_info crts_proc_info;
extern CRTS_Thrd_info crts_thrd_info_h;

extern volatile CRTS_Node_cross *crts_node_cross;
extern int crts_sldm_size_h, crts_sldm_mode_h, crts_sldm_scap_h;
extern unsigned long crts_sldm_len_h;
typedef void*(*CRTS_FUNCPTR)(void*);
void CRTS_sig_user_init (CRTS_FUNCPTR funp);
# 181 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 1 3 4
# 182 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 2 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread_core.h" 1 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread_common.h" 1 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ioctl.h" 1 3 4
# 24 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ioctl.h" 3 4



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctls.h" 1 3 4
# 24 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctls.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/ioctls.h" 1 3 4



# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/ioctl.h" 1 3 4
# 5 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/ioctls.h" 2 3 4
# 25 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctls.h" 2 3 4
# 37 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctls.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/linux/sockios.h" 1 3 4
# 21 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/linux/sockios.h" 3 4
# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/asm/sockios.h" 1 3 4
# 22 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/linux/sockios.h" 2 3 4
# 37 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctls.h" 2 3 4
# 28 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ioctl.h" 2 3 4


# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctl-types.h" 1 3 4
# 28 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/bits/ioctl-types.h" 3 4
struct winsize
  {
    unsigned short int ws_row;
    unsigned short int ws_col;
    unsigned short int ws_xpixel;
    unsigned short int ws_ypixel;
  };


struct termio
  {
    unsigned short int c_iflag;
    unsigned short int c_oflag;
    unsigned short int c_cflag;
    unsigned short int c_lflag;
    unsigned char c_line;
    unsigned char c_cc[8];
};
# 31 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ioctl.h" 2 3 4






# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ttydefaults.h" 1 3 4
# 38 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/sys/ioctl.h" 2 3 4




extern int ioctl (int __fd, unsigned long int __request, ...) __attribute__ ((__nothrow__));


# 4 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread_common.h" 2 3 4
# 29 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread_common.h" 3 4
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned long uint64_t;

extern int slave_fd, stask_fd, sjob_fd;

typedef struct s_thread_info {
 char valid;
 int thread_id;
 int core_num;
 volatile int state_flag;
 void *pc;
 void *arg;
 char fini_sig;
 long gid;
 int team_size;
 int flush_slave_cache;
} thread_info_t;




extern long *_tdata_local_start __attribute__((weak));
extern long *_tdata_local_end __attribute__((weak));
extern long *_tdata_private_start __attribute__((weak));
extern long *_tdata_private_end __attribute__((weak));
extern long *_tdata_local_fix_end __attribute__((weak));
# 2 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/athread_core.h" 2 3 4
# 183 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 2 3 4
# 209 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern __uncached thread_info_t __v_core_info[6][64];
extern volatile __uncached __cross CRTS_Node_cross crts_node_cross_info;


typedef volatile int crts_rply_t;

extern __attribute__ ((section (".ldm_fix"))) CRTS_Thrd_info crts_thrd_info;
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_reg_tmp[2];
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RB;
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RC;
extern __attribute__ ((section (".ldm_fix"))) volatile crts_rply_t __crts_rply;
extern __attribute__ ((section (".ldm_fix"))) volatile crts_rply_t __crts_rma_rply;
extern __attribute__ ((section (".ldm_fix"))) int crts_sldm_id, crts_sldm_size;
extern __attribute__ ((section (".ldm_fix"))) volatile unsigned long __ldm_start_addr;
extern __attribute__ ((section (".ldm_fix"))) unsigned long crts_ldm_malloc_end;
extern __attribute__ ((section (".ldm_fix"))) int CRTS_row_size, CRTS_col_size;
# 277 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern __attribute__ ((section (".ldm_fix"))) int crts_sldm_id;






extern void ldm_free_all();
extern void* ldm_malloc_max(size_t *size);
# 304 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern int CRTS_scoll_alltoall(void *src_addr, void *dest_addr, int units_size);
extern void CRTS_scoll_alltoall_inplace(void *src_addr, int units_size, void *buf, int buf_item);
extern int
CRTS_scoll_redurt(
 void *src_addr,
 void *dest_addr,
 int units,
 int dtype,
 int optype,
 void *redu_buf,
 int buf_item);
# 501 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern __uncached volatile int64_t __crts_master_spe_sync[64];
extern __uncached volatile int64_t __crts_master_array_sync;
extern __uncached volatile int64_t __crts_master_spe_sync_all[6][64];
extern __uncached volatile int64_t __crts_master_array_sync_all[6];
# 582 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_reg_tmp[2];
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RB;
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RC;
extern __attribute__ ((section (".ldm_fix"))) crts_rply_t __crts_rply;
extern __attribute__ ((section (".ldm_fix"))) crts_rply_t __crts_rma_rply;
# 965 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern int my_printf(const char* ss,...);



extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_reg_tmp[2] __attribute__ ((aligned(64)));
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RB;
extern __attribute__ ((section (".ldm_fix"))) uint64_t __crts_RC;
extern __attribute__ ((section (".ldm_fix"))) crts_rply_t __crts_rply;
extern __attribute__ ((section (".ldm_fix"))) crts_rply_t __crts_rma_rply;
extern __attribute__ ((section (".ldm_fix"))) int __ldm_size;
extern __attribute__ ((section (".ldm_fix"))) int __ldm_stack_size;

extern int CRTS_ssig_queue( int pid, int signum, const sigval_t value );
# 1145 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern int CRTS_memcpy_sldm(void *dest_addr, void *src_addr, int size, int direction);
extern int CRTS_sldm_get (void *dest_addr, void *src_addr, int size);
extern void CRTS_sldm_get_arrayshare (void *dest_addr, void *src_addr, int size);
extern void CRTS_sio_fwrite(char* filename, void* src, unsigned long size);
# 1471 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
int CRTS_smutex_lock_node (void);
int CRTS_smutex_unlock_node (void);
int CRTS_smutex_lock_master_array(void);
int CRTS_smutex_unlock_master_array(void);
void CRTS_smutex_lock_node_all (void);
void CRTS_smutex_unlock_node_all (void);



uint32_t get_allocatable_size(void);
void init_ldm_stack_state(void);
void* get_allocatable_addr(void);
void* ldm_malloc(size_t size);
void ldm_free(void *addr, size_t size);


void CRTS_initialize_lock_vars(void);
int CRTS_smutex_lock_array(void);
int CRTS_smutex_unlock_array(void);
int CRTS_smutex_init_array_custom(void);
int CRTS_smutex_lock_array_custom(int lockid);
int CRTS_smutex_unlock_array_custom(int lockid);
int CRTS_smutex_free_array_custom(int lockid);
int CRTS_smutex_lock_2spe(void);
int CRTS_smutex_unlock_2spe(void);
int CRTS_smutex_init_2spe_custom(void);
int CRTS_smutex_lock_2spe_custom(int lockid);
int CRTS_smutex_unlock_2spe_custom(int lockid);
int CRTS_smutex_free_2spe_custom(int lockid);
int CRTS_smutex_lock_1spc(void);
int CRTS_smutex_unlock_1spc(void);
int CRTS_smutex_init_1spc_custom(void);
int CRTS_smutex_lock_1spc_custom(int lockid);
int CRTS_smutex_unlock_1spc_custom(int lockid);
int CRTS_smutex_free_1spc_custom(int lockid);
int CRTS_smutex_lock_row(void);
int CRTS_smutex_unlock_row(void);
int CRTS_smutex_lock_col(void);
int CRTS_smutex_unlock_col(void);
int CRTS_smutex_lock_2spc(void);
int CRTS_smutex_unlock_2spc(void);




int CRTS_smutex_lock_16spe(void);
int CRTS_smutex_unlock_16spe(void);
int CRTS_smutex_init_16spe_custom(void);
int CRTS_smutex_lock_16spe_custom(int lockid);
int CRTS_smutex_unlock_16spe_custom(int lockid);
int CRTS_smutex_free_16spe_custom(int lockid);
int CRTS_smutex_lock_32spe(void);
int CRTS_smutex_unlock_32spe(void);
int CRTS_smutex_init_32spe_custom(void);
int CRTS_smutex_lock_32spe_custom(int lockid);
int CRTS_smutex_unlock_32spe_custom(int lockid);
int CRTS_smutex_free_32spe_custom(int lockid);
# 1545 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
typedef unsigned uintv16 __attribute__ ((__mode__(__V16SI__)));
# 1572 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts.h" 3 4
extern uintv16 CRTS_ptab_cpy(unsigned int *orig_table_addr[16], int unit,int num,unsigned int *ptable);
extern uintv16 CRTS_ptab_cpy16(unsigned int *orig_table_addr, int unit,unsigned int *ptable);
# 3 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts2ath.h" 2 3 4
# 178 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/crts2ath.h" 3 4
typedef volatile long athread_rply_t;
# 138 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 2 3 4
# 254 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/slave.h" 3 4
typedef enum {
        PE_MODE,
        COL_MODE=2
} dma_mode;

typedef enum {
        DMA_PUT,
        DMA_GET,
        DMA_PUT_P,
        DMA_GET_P,
        DMA_BARRIER = 5,
        ALL_BARRIER = 6
} DMA_OP;

typedef enum {
 ROW_SCOPE,
 COL_SCOPE,
 ARRAY_SCOPE,
 PP_SCOPE,
}scope;




extern int athread_syn(scope scp,int mask);

extern __attribute__ ((section (".ldm_fix"))) char _CGN,_ROW,_COL,_PEN;
extern __attribute__ ((section (".ldm_fix"))) volatile void (*_PC)();
extern __attribute__ ((section (".ldm_fix"))) volatile void (*_ARG)();
extern __attribute__ ((section (".ldm_fix"))) int _MYID;
extern __attribute__ ((section (".ldm_fix"))) int _cache_size, _ldm_share_mode, _ldm_share_size, _ldm_share_size_3bit;




long get_slave_cache_size();
long get_slave_ldmshare_size();
void evict_slave_cache_cont(void* start, void* end);
void flush_slave_cache();
int set_cache_size(int cache_size);
int set_ldm_mode_size(int ldm_share_mode, int ldm_share_size);
void set_ptr_uncached(void **addr);
void set_ptr_cached(void **addr);

int ordered_printf(const char * __restrict format, ...);

void* ldm_malloc(size_t size);
void ldm_free(void *addr, size_t size);

static __inline float16 __attribute__((__always_inline__))
sqrth (float16 __x)
{
        return (float16) __builtin_sw_slave_sqrth(__x);
}

extern __attribute__ ((section (".ldm"))) unsigned short _divhfm;
extern __attribute__ ((section (".ldm"))) unsigned short _divhfone;
extern __attribute__ ((section (".ldm"))) unsigned int _divvhfone;
static inline void set_fp16_mode()
{
 _divhfm=0x7798;
 _divhfone=0x3c00;
 _divvhfone=0x3c003c00;
 unsigned long fpcr0,fpcr1;
 {asm volatile("rfpcr $63\n\tvextf $63,0,%0\n\tvextf $63,1,%1":"=r"(fpcr0),"=r"(fpcr1)::);};
 fpcr0 &= (~(1ULL<<43));
 {asm volatile("vinsf %0,$63,0,$63\n\tvinsf %1,$63,1,$63\n\twfpcr $63"::"r"(fpcr0),"r"(fpcr1):"memory");};
}

static inline void set_bf16_mode()
{
 _divhfm=0x7ef3;
 _divhfone=0x3f80;
 _divvhfone=0x3f803f80;
 unsigned long fpcr0,fpcr1;
 {asm volatile("rfpcr $63\n\tvextf $63,0,%0\n\tvextf $63,1,%1":"=r"(fpcr0),"=r"(fpcr1)::);};
 fpcr0 |= (1ULL<<43);
 {asm volatile("vinsf %0,$63,0,$63\n\tvinsf %1,$63,1,$63\n\twfpcr $63"::"r"(fpcr0),"r"(fpcr1):"memory");};
}

static inline float16 fcvthh(float16 __a)
{
 return __builtin_sw_slave_fcvthh(__a);
}

static inline void convert_float16(float16 *dest, float16 *src, int num)
{
 int i;
 for(i=0;i<num;i++)
  dest[i]=fcvthh(src[i]);
}
# 6 "ldm_privatequeue.h" 2






# 11 "ldm_privatequeue.h"
void slave_ldmq_push(struct task* t);
# 12 "scheduler_slave.c" 2
# 1 "reg_transfer.h" 1






# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 1 3 4
# 51 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4




# 54 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/usr_sw/include/assert.h" 3 4
extern void __assert (const char *, const char *, int, const char *);


# 8 "reg_transfer.h" 2
# 1 "scheduler.h" 1
# 9 "scheduler.h"
# 1 "scheduler_common.h" 1
# 10 "scheduler.h" 2
# 28 "scheduler.h"

# 28 "scheduler.h"
typedef struct generic_scheduler
{
  int id;
# 47 "scheduler.h"
  struct concurrent_aceMesh_stack private_queue;
# 58 "scheduler.h"
  struct concurrent_aceMesh_stack master_private_queue;




  struct aceMesh_queue blocking_queue;
# 86 "scheduler.h"
}generic_scheduler;
# 118 "scheduler.h"
void slave_local_spawn(generic_scheduler *my_scheduler,struct task* t);
void slave_scheduler_enqueue(struct task* t);
void slave_spawn_to_id(struct task* t);
void *slave_worker_kernel_func();






void local_spawn(generic_scheduler *my_scheduler,struct task* t);

void local_spawn_master(generic_scheduler *my_scheduler,struct task* t);

void init_spawn_sche(struct task* t);
void wait_for_all();
void create_worker_thread_p(int n_threads, int p[]);
void main_kernel_func(struct task* p);
# 9 "reg_transfer.h" 2




struct task_chip_buff
{
    struct task* base[8];
    volatile int head;
    volatile int tail;
    int send_num;
    int recv_num;
};
void init_chip_queue();
void slave_clear_RegNT_to_need_spawn();
# 43 "reg_transfer.h"
void slave_sendtask2PE(struct task* p, int destid);
int slave_recvtaskfromRegNT();
# 13 "scheduler_slave.c" 2

# 1 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/simd.h" 1 3 4
# 1840 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/simd.h" 3 4

# 1840 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/simd.h" 3 4
typedef int intv16 __attribute__ ((__mode__(__V16SI__)));
typedef unsigned uintv16 __attribute__ ((__mode__(__V16SI__)));
typedef int int512 __attribute__ ((__mode__(__V1XI__)));
typedef unsigned uint512 __attribute__ ((__mode__(__V1XI__)));
typedef float floatv8 __attribute__ ((__mode__(__V8SF__)));
typedef double doublev8 __attribute__ ((__mode__(__V8DF__)));



#pragma ccc thread_code_begin
static __inline intv16 __attribute__((__always_inline__))
simd_set_intv16 (int __K, int __L, int __M, int __N, int __O, int __P, int __Q, int __R, int __S, int __T, int __U, int __V, int __W, int __X, int __Y, int __Z)
{
    union {
    int __a[16] __attribute__ ((aligned (64)));
    intv16 __v;
  } __u;

  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  __u.__a[8] = __S;
  __u.__a[9] = __T;
  __u.__a[10] = __U;
  __u.__a[11] = __V;
  __u.__a[12] = __W;
  __u.__a[13] = __X;
  __u.__a[14] = __Y;
  __u.__a[15] = __Z;

  return __u.__v;
}

static __inline uintv16 __attribute__((__always_inline__))
simd_set_uintv16 (unsigned int __K, unsigned int __L, unsigned int __M, unsigned int __N, unsigned int __O, unsigned int __P, unsigned int __Q, unsigned int __R, unsigned int __S, unsigned int __T, unsigned int __U, unsigned int __V, unsigned int __W, unsigned int __X, unsigned int __Y, unsigned int __Z)
{
    union {
    unsigned int __a[16] __attribute__ ((aligned (64)));
    uintv16 __v;
  } __u;

  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  __u.__a[8] = __S;
  __u.__a[9] = __T;
  __u.__a[10] = __U;
  __u.__a[11] = __V;
  __u.__a[12] = __W;
  __u.__a[13] = __X;
  __u.__a[14] = __Y;
  __u.__a[15] = __Z;

  return __u.__v;
}

static __inline int512
simd_set_int512 (long __K, long __L, long __M, long __N, long __O, long __P, long __Q, long __R)
{
  union {
    long __a[8];
    int512 __v;
  } __u;
  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  return __u.__v;
}

static __inline uint512
simd_set_uint512 (unsigned long __K, unsigned long __L, unsigned long __M, unsigned long __N, unsigned long __O, unsigned long __P, unsigned long __Q, unsigned long __R)
{
  union {
    unsigned long __a[8];
    uint512 __v;
  } __u;
  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  return __u.__v;
}

static __inline doublev8
simd_set_doublev8 (double __K, double __L, double __M, double __N, double __O, double __P, double __Q, double __R)
{
  union {
    double __a[8];
    doublev8 __v;
  } __u;
  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  return __u.__v;
}

static __inline floatv8
simd_set_floatv8 (float __K, float __L, float __M, float __N, float __O, float __P, float __Q, float __R)
{
  union {
    float __a[8];
    floatv8 __v;
  } __u;
  __u.__a[0] = __K;
  __u.__a[1] = __L;
  __u.__a[2] = __M;
  __u.__a[3] = __N;
  __u.__a[4] = __O;
  __u.__a[5] = __P;
  __u.__a[6] = __Q;
  __u.__a[7] = __R;
  return __u.__v;
}

static __inline void __attribute__((__always_inline__))
simd_fprint_intv16 (FILE *fp, intv16 a)
{
  union {
    int __a[16];
    intv16 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d ]\n", __u.__a[15], __u.__a[14], __u.__a[13], __u.__a[12], __u.__a[11], __u.__a[10], __u.__a[9], __u.__a[8], __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_intv16_X (FILE *fp, intv16 a)
{
  union {
    int __a[16];
    intv16 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x ]\n", __u.__a[15], __u.__a[14], __u.__a[13], __u.__a[12], __u.__a[11], __u.__a[10], __u.__a[9], __u.__a[8], __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_uintv16 (FILE *fp, uintv16 a)
{
  union {
    unsigned int __a[16];
    uintv16 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u ]\n", __u.__a[15], __u.__a[14], __u.__a[13], __u.__a[12], __u.__a[11], __u.__a[10], __u.__a[9], __u.__a[8], __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_uintv16_X (FILE *fp, uintv16 a)
{
  union {
    unsigned int __a[16];
    uintv16 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x ]\n", __u.__a[15], __u.__a[14], __u.__a[13], __u.__a[12], __u.__a[11], __u.__a[10], __u.__a[9], __u.__a[8], __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_int512 (FILE *fp, int512 a)
{
  volatile union {
    long __a[8];
    int512 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_int512_X (FILE *fp, int512 a)
{
  volatile union {
    long __a[8];
    int512 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_uint512 (FILE *fp, uint512 a)
{
  volatile union {
    unsigned long __a[8];
    uint512 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_uint512_X (FILE *fp, uint512 a)
{
  volatile union {
    unsigned long __a[8];
    uint512 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_doublev8 (FILE *fp, doublev8 a)
{
  union {
    double __a[8];
    doublev8 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %e, %e, %e, %e, %e, %e, %e, %e ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_doublev8_X (FILE *fp, doublev8 a)
{
  union {
    double __a[8];
    doublev8 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx ]\n", *(long *)(&__u.__a[7]),*(long *)(&__u.__a[6]), *(long *)(&__u.__a[5]), *(long *)(&__u.__a[4]), *(long *)(&__u.__a[3]), *(long *)(&__u.__a[2]), *(long *)(&__u.__a[1]), *(long *)(&__u.__a[0]));
}

static __inline void __attribute__((__always_inline__))
simd_fprint_floatv8 (FILE *fp, floatv8 a)
{
  union {
    float __a[8];
    floatv8 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ %e, %e, %e, %e, %e, %e, %e, %e ]\n", __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_floatv8_X (FILE *fp, floatv8 a)
{
  union {
    float __a[8];
    floatv8 __v;
  } __u;
  __u.__v = a;
  fprintf (fp, "[ 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x ]\n", *(int *)(&__u.__a[7]), *(int *)(&__u.__a[6]), *(int *)(&__u.__a[5]), *(int *)(&__u.__a[4]), *(int *)(&__u.__a[3]), *(int *)(&__u.__a[2]), *(int *)(&__u.__a[1]), *(int *)(&__u.__a[0]));
}

static __inline void __attribute__((__always_inline__)) simd_print_doublev8 (doublev8 a) { simd_fprint_doublev8 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_doublev8_X (doublev8 a) { simd_fprint_doublev8_X (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_floatv8 (floatv8 a) { simd_fprint_floatv8 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_floatv8_X (floatv8 a) { simd_fprint_floatv8_X (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_intv16 (intv16 a) { simd_fprint_intv16 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_intv16_X (intv16 a) { simd_fprint_intv16_X (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_uintv16 (uintv16 a) { simd_fprint_uintv16 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_uintv16_X (uintv16 a) { simd_fprint_uintv16_X (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_int512 (int512 a) { simd_fprint_int512 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_int512_X (int512 a) { simd_fprint_int512_X (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_uint512 (uint512 a) { simd_fprint_uint512 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_uint512_X (uint512 a) { simd_fprint_uint512_X (_slave_stdout, a); }

static __inline intv16 __attribute__((__always_inline__))
simd_vandw (intv16 __A, intv16 __B)
{
 return (intv16) (__A & __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vbicw (intv16 __A, intv16 __B)
{
 return (intv16) (__A &~ __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vbisw (intv16 __A, intv16 __B)
{
 return (intv16) (__A | __B);
}
# 2155 "/usr/sw/swgcc/swgcc710-tools-SEA-1307/shared_include/simd.h" 3 4
static __inline intv16 __attribute__((__always_inline__))
simd_vornotw (intv16 __A, intv16 __B)
{
 return (intv16) (__A |~ __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vnotw (intv16 __A)
{
 return (intv16) (~__A);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vxorw (intv16 __A, intv16 __B)
{
 return (intv16) (__A ^ __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vandl (int512 __A, int512 __B)
{
 return (int512) (__A & __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vbicl (int512 __A, int512 __B)
{
 return (int512) (__A &~ __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vbisl (int512 __A, int512 __B)
{
 return (int512) (__A | __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vornotl (int512 __A, int512 __B)
{
 return (int512) (__A |~ __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vnotl (int512 __A)
{
 return (int512) (~__A);
}

static __inline int512 __attribute__((__always_inline__))
simd_vxorl (int512 __A, int512 __B)
{
 return (int512) (__A ^ __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vaddw (intv16 __A, intv16 __B)
{
 return (intv16) (__A + __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vaddwi (intv16 __A, const int __B)
{
 return (intv16) (__A + __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vsubw (intv16 __A, intv16 __B)
{
 return (intv16) (__A - __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vsubwi (intv16 __A, const int __B)
{
 return (intv16) (-__B + __A);
}

static __inline int512 __attribute__((__always_inline__))
simd_vaddl (int512 __A, int512 __B)
{
 return (int512) (__A + __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vaddli (int512 __A, const int __B)
{
 return (int512) (__A + __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vsubl (int512 __A, int512 __B)
{
 return (int512) (__A - __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_vsubli (int512 __A, const int __B)
{
 return (int512) (-__B + __A);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vsllw (uintv16 __A, uintv16 __B)
{
        return (uintv16) __builtin_sw_slave_vsllw(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vsllwi (uintv16 __A, const int __B)
{
 return (uintv16) __builtin_sw_slave_vsllwi(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vsrlw (uintv16 __A, uintv16 __B)
{
 return __builtin_sw_slave_vsrlw(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vsrlwi (uintv16 __A, const int __B)
{
 return __builtin_sw_slave_vsrlwi(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vsraw (intv16 __A, intv16 __B)
{
        return __builtin_sw_slave_vsraw(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vsrawi (intv16 __A, const int __B)
{
 return __builtin_sw_slave_vsrawi(__A, __B);
}

static __inline int512 __attribute__((__always_inline__))
simd_sllx (int512 __A, int __B)
{
        return (int512) (__A<<__B);
}

static __inline int512 __attribute__((__always_inline__))
simd_srlx (int512 __A, int __B)
{
        return (int512) (__A>>__B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vrolw (intv16 __A, intv16 __B)
{
        return (intv16) __builtin_sw_slave_vrolw(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vrolwi (intv16 __A, const int __B)
{
        return (intv16) __builtin_sw_slave_vrolwi(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vadds (floatv8 __A, floatv8 __B)
{
 return (floatv8)(__A + __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vsubs (floatv8 __A, floatv8 __B)
{
 return (floatv8)(__A - __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vmuls (floatv8 __A, floatv8 __B)
{
 return (floatv8)(__A * __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vaddd (doublev8 __A, doublev8 __B)
{
 return (doublev8)(__A + __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vsubd (doublev8 __A, doublev8 __B)
{
 return (doublev8)(__A - __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vmuld (doublev8 __A, doublev8 __B)
{
 return (doublev8)(__A * __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfcmpeqs (floatv8 __A, floatv8 __B)
{

        return (floatv8)(__A == __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfcmples (floatv8 __A, floatv8 __B)
{

        return (floatv8)(__A <= __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfcmplts (floatv8 __A, floatv8 __B)
{

        return (floatv8)(__A < __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfcmpuns (floatv8 __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vfcmpuns(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfcmpeqd (doublev8 __A, doublev8 __B)
{

        return (doublev8)(__A == __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfcmpled (doublev8 __A, doublev8 __B)
{

        return (doublev8)(__A <= __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfcmpltd (doublev8 __A, doublev8 __B)
{

        return (doublev8)(__A < __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfcmpund (doublev8 __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vfcmpund(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vcpyss (floatv8 __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vcpyss(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vcpysns (floatv8 __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vcpysns(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vcpyses (floatv8 __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vcpyses(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vcpysd (doublev8 __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vcpysd(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vcpysnd (doublev8 __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vcpysnd(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vcpysed (doublev8 __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vcpysed(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vmas (floatv8 __A, floatv8 __B, floatv8 __C)
{

        return (__A*__B+__C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vmss (floatv8 __A, floatv8 __B, floatv8 __C)
{

        return (__A*__B-__C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vnmas (floatv8 __A, floatv8 __B, floatv8 __C)
{

        return (-__A*__B+__C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vnmss (floatv8 __A, floatv8 __B, floatv8 __C)
{

        return (-__A*__B-__C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vmad (doublev8 __A, doublev8 __B, doublev8 __C)
{

        return (__A*__B+__C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vmsd (doublev8 __A, doublev8 __B, doublev8 __C)
{

        return (__A*__B-__C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vnmad (doublev8 __A, doublev8 __B, doublev8 __C)
{

        return (-__A*__B+__C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vnmsd (doublev8 __A, doublev8 __B, doublev8 __C)
{

        return (-__A*__B-__C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfseleqs (floatv8 __A, floatv8 __B, floatv8 __C)
{
        return (floatv8)__builtin_sw_slave_vseleqs(__A, __B, __C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfselles (floatv8 __A, floatv8 __B, floatv8 __C)
{
        return (floatv8)__builtin_sw_slave_vselles(__A, __B, __C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfsellts (floatv8 __A, floatv8 __B, floatv8 __C)
{
        return (floatv8)__builtin_sw_slave_vsellts(__A, __B, __C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfseleqd (doublev8 __A, doublev8 __B, doublev8 __C)
{
        return (doublev8)__builtin_sw_slave_vseleqd(__A, __B, __C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfselled (doublev8 __A, doublev8 __B, doublev8 __C)
{
        return (doublev8)__builtin_sw_slave_vselled(__A, __B, __C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfselltd (doublev8 __A, doublev8 __B, doublev8 __C)
{
        return (doublev8)__builtin_sw_slave_vselltd(__A, __B, __C);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vconw (intv16 __A, intv16 __B, void * __C)
{
        return (intv16)__builtin_sw_slave_vconw(__A, __B, __C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vcons (floatv8 __A, floatv8 __B, void * __C)
{
        return (floatv8)__builtin_sw_slave_vcons(__A, __B, __C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vcond (doublev8 __A, doublev8 __B, void * __C)
{
        return (doublev8)__builtin_sw_slave_vcond(__A, __B, __C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs (float __A, floatv8 __B, const int __C)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, __C);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs0 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 0);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs1 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 1);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs2 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 2);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs3 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 3);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs4 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 4);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs5 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 5);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs6 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 6);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vinsfs7 (float __A, floatv8 __B)
{
        return (floatv8)__builtin_sw_slave_vinsfs(__A, __B, 7);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd (double __A, doublev8 __B, const int __C)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, __C);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd0 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 0);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd1 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 1);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd2 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 2);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd3 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 3);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd4 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 4);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd5 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 5);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd6 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 6);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vinsfd7 (double __A, doublev8 __B)
{
        return (doublev8)__builtin_sw_slave_vinsfd(__A, __B, 7);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl (long __A, int512 __B, const int __C)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, __C);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl0 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 0);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl1 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 1);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl2 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 2);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl3 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 3);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl4 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 4);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl5 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 5);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl6 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 6);
}

static __inline int512 __attribute__((__always_inline__))
simd_vinsl7 (long __A, int512 __B)
{
        return (int512)__builtin_sw_slave_vinsl(__A, __B, 7);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw (int __A, intv16 __B, const int __C)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, __C);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw0 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 0);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw1 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 1);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw2 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 2);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw3 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 3);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw4 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 4);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw5 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 5);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw6 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 6);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw7 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 7);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw8 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 8);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw9 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 9);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw10 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 10);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw11 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 11);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw12 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 12);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw13 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 13);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw14 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 14);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vinsw15 (int __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vinsw(__A, __B, 15);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs (floatv8 __A, const int __B)
{
        return (float)__builtin_sw_slave_vextfs(__A, __B);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs0 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 0);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs1 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 1);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs2 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 2);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs3 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 3);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs4 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 4);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs5 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 5);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs6 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 6);
}

static __inline float __attribute__((__always_inline__))
simd_vextfs7 (floatv8 __A)
{
        return (float)__builtin_sw_slave_vextfs(__A, 7);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd (doublev8 __A, const int __B)
{
        return (double)__builtin_sw_slave_vextfd(__A, __B);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd0 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 0);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd1 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 1);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd2 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 2);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd3 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 3);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd4 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 4);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd5 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 5);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd6 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 6);
}

static __inline double __attribute__((__always_inline__))
simd_vextfd7 (doublev8 __A)
{
        return (double)__builtin_sw_slave_vextfd(__A, 7);
}
static __inline int __attribute__((__always_inline__))
simd_vextw (intv16 __A, const int __B)
{
        return (int)__builtin_sw_slave_vextw(__A, __B);
}

static __inline int __attribute__((__always_inline__))
simd_vextw0 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 0);
}

static __inline int __attribute__((__always_inline__))
simd_vextw1 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 1);
}

static __inline int __attribute__((__always_inline__))
simd_vextw2 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 2);
}

static __inline int __attribute__((__always_inline__))
simd_vextw3 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 3);
}

static __inline int __attribute__((__always_inline__))
simd_vextw4 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 4);
}

static __inline int __attribute__((__always_inline__))
simd_vextw5 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 5);
}

static __inline int __attribute__((__always_inline__))
simd_vextw6 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 6);
}

static __inline int __attribute__((__always_inline__))
simd_vextw7 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 7);
}

static __inline int __attribute__((__always_inline__))
simd_vextw8 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 8);
}

static __inline int __attribute__((__always_inline__))
simd_vextw9 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 9);
}

static __inline int __attribute__((__always_inline__))
simd_vextw10 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 10);
}

static __inline int __attribute__((__always_inline__))
simd_vextw11 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 11);
}

static __inline int __attribute__((__always_inline__))
simd_vextw12 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 12);
}

static __inline int __attribute__((__always_inline__))
simd_vextw13 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 13);
}

static __inline int __attribute__((__always_inline__))
simd_vextw14 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 14);
}

static __inline int __attribute__((__always_inline__))
simd_vextw15 (intv16 __A)
{
        return (int)__builtin_sw_slave_vextw(__A, 15);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vcpyfs (float __A)
{
        return (floatv8)__builtin_sw_slave_vcpyfs(__A);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vcpyfd (double __A)
{
        return (doublev8)__builtin_sw_slave_vcpyfd(__A);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcpyw (int __A)
{
        return (intv16)__builtin_sw_slave_vcpyw(__A);
}

static __inline int512 __attribute__((__always_inline__))
simd_vcpyl (long __A)
{
        return (int512)__builtin_sw_slave_vcpyfl(__A);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vlog2xi(intv16 __A,intv16 __B,const int __C)
{
 return (intv16)__builtin_sw_slave_vlog2xi(__A,__B,__C);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vlog2xi_i(intv16 __A,const int __B,const int __C)
{
 return (intv16)__builtin_sw_slave_vlog2xi_i(__A,__B,__C);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vlog3ri(intv16 __A,intv16 __B,intv16 __C,const int __D)
{
 return (intv16)__builtin_sw_slave_vlog3ri(__A,__B,__C,__D);
}

static __inline int512 __attribute__((__always_inline__))
simd_vlog2xx(int512 __A,int512 __B,const int __C)
{
 return (int512)__builtin_sw_slave_vlog2xx(__A,__B,__C);
}

static __inline int512 __attribute__((__always_inline__))
simd_vlog2xx_i(int512 __A,const int __B,const int __C)
{
 return (int512)__builtin_sw_slave_vlog2xx_i(__A,__B,__C);
}

static __inline int512 __attribute__((__always_inline__))
simd_vlog3rx(int512 __A,int512 __B,int512 __C,const int __D)
{
 return (int512)__builtin_sw_slave_vlog3rx(__A,__B,__C,__D);
}

static __inline int __attribute__((__always_inline__))
simd_reduc_plusw (intv16 __A)
{
        return (int) __builtin_sw_slave_reduc_plusw(__A);
}

static __inline float __attribute__((__always_inline__))
simd_reduc_pluss (floatv8 __A)
{
        return (float) __builtin_sw_slave_reduc_pluss(__A);
}

static __inline double __attribute__((__always_inline__))
simd_reduc_plusd (doublev8 __A)
{
        return (double) __builtin_sw_slave_reduc_plusd(__A);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_smaxs (floatv8 __A, floatv8 __B)
{
        return (floatv8) __builtin_sw_slave_smaxs(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_smaxd (doublev8 __A, doublev8 __B)
{
        return (doublev8) __builtin_sw_slave_smaxd(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_smins (floatv8 __A, floatv8 __B)
{
        return (floatv8) __builtin_sw_slave_smins(__A, __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_smind (doublev8 __A, doublev8 __B)
{
        return (doublev8) __builtin_sw_slave_smind(__A, __B);
}

static __inline float __attribute__((__always_inline__))
simd_reduc_smaxs (floatv8 __A)
{
        return (float) __builtin_sw_slave_reduc_smaxs(__A);
}

static __inline double __attribute__((__always_inline__))
simd_reduc_smaxd (doublev8 __A)
{
        return (double) __builtin_sw_slave_reduc_smaxd(__A);
}

static __inline float __attribute__((__always_inline__))
simd_reduc_smins (floatv8 __A)
{
        return (float) __builtin_sw_slave_reduc_smins(__A);
}

static __inline double __attribute__((__always_inline__))
simd_reduc_smind (doublev8 __A)
{
        return (double) __builtin_sw_slave_reduc_smind(__A);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vdivs (floatv8 __A, floatv8 __B)
{
 return (floatv8)(__A / __B);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vdivd (doublev8 __A, doublev8 __B)
{
 return (doublev8)(__A / __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vsqrts (floatv8 __x)
{
 return (floatv8) __builtin_sw_slave_vsqrts(__x);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vsqrtd (doublev8 __x)
{
 return (doublev8) __builtin_sw_slave_vsqrtd(__x);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfrecs (floatv8 __x)
{
 return (floatv8) __builtin_sw_slave_vfrecs(__x);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfrecd (doublev8 __x)
{
 return (doublev8) __builtin_sw_slave_vfrecd(__x);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfrecps (floatv8 __x)
{
 return (floatv8) __builtin_sw_slave_vfrecps(__x);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vfrecpd (doublev8 __x)
{
 return (doublev8) __builtin_sw_slave_vfrecpd(__x);
}



typedef _Float16 float16v32 __attribute__ ((__mode__(__V32HF__)));
static __inline float16v32
simd_set_float16v32 (_Float16 __a0, _Float16 __a1, _Float16 __a2, _Float16 __a3, _Float16 __a4, _Float16 __a5, _Float16 __a6, _Float16 __a7, _Float16 __a8, _Float16 __a9, _Float16 __a10, _Float16 __a11, _Float16 __a12, _Float16 __a13, _Float16 __a14, _Float16 __a15, _Float16 __a16, _Float16 __a17, _Float16 __a18, _Float16 __a19, _Float16 __a20, _Float16 __a21, _Float16 __a22, _Float16 __a23, _Float16 __a24, _Float16 __a25, _Float16 __a26, _Float16 __a27, _Float16 __a28, _Float16 __a29, _Float16 __a30, _Float16 __a31)
{
  union {
    _Float16 __a[32];
    float16v32 __v;
  } __u;
  __u.__a[0] = __a0;
  __u.__a[1] = __a1;
  __u.__a[2] = __a2;
  __u.__a[3] = __a3;
  __u.__a[4] = __a4;
  __u.__a[5] = __a5;
  __u.__a[6] = __a6;
  __u.__a[7] = __a7;
  __u.__a[8] = __a8;
  __u.__a[9] = __a9;
  __u.__a[10] = __a10;
  __u.__a[11] = __a11;
  __u.__a[12] = __a12;
  __u.__a[13] = __a13;
  __u.__a[14] = __a14;
  __u.__a[15] = __a15;
  __u.__a[16] = __a16;
  __u.__a[17] = __a17;
  __u.__a[18] = __a18;
  __u.__a[19] = __a19;
  __u.__a[20] = __a20;
  __u.__a[21] = __a21;
  __u.__a[22] = __a22;
  __u.__a[23] = __a23;
  __u.__a[24] = __a24;
  __u.__a[25] = __a25;
  __u.__a[26] = __a26;
  __u.__a[27] = __a27;
  __u.__a[28] = __a28;
  __u.__a[29] = __a29;
  __u.__a[30] = __a30;
  __u.__a[31] = __a31;
  return __u.__v;
}

static __inline void __attribute__((__always_inline__))
simd_fprint_float16v32 (FILE *fp, float16v32 a)
{
  union {
    _Float16 __a[32];
    float16v32 __v;
  } __u;
  __u.__v = a;

  fprintf (fp, "[ %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e, %e ]\n", (float)__u.__a[31], (float)__u.__a[30], (float)__u.__a[29], (float)__u.__a[28], (float)__u.__a[27], (float)__u.__a[26], (float)__u.__a[25], (float)__u.__a[24], (float)__u.__a[23], (float)__u.__a[22], (float)__u.__a[21], (float)__u.__a[20], (float)__u.__a[19], (float)__u.__a[18], (float)__u.__a[17], (float)__u.__a[16], (float)__u.__a[15], (float)__u.__a[14], (float)__u.__a[13], (float)__u.__a[12], (float)__u.__a[11], (float)__u.__a[10], (float)__u.__a[9], (float)__u.__a[8], (float)__u.__a[7], (float)__u.__a[6], (float)__u.__a[5], (float)__u.__a[4], (float)__u.__a[3], (float)__u.__a[2], (float)__u.__a[1], (float)__u.__a[0]);
}

static __inline void __attribute__((__always_inline__))
simd_fprint_float16v32_X (FILE *fp, float16v32 a)
{
  union {
    short __a[32];
    float16v32 __v;
  } __u;
  __u.__v = a;

  fprintf (fp, "[ 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x ]\n", __u.__a[31], __u.__a[30], __u.__a[29], __u.__a[28], __u.__a[27], __u.__a[26], __u.__a[25], __u.__a[24], __u.__a[23], __u.__a[22], __u.__a[21], __u.__a[20], __u.__a[19], __u.__a[18], __u.__a[17], __u.__a[16], __u.__a[15], __u.__a[14], __u.__a[13], __u.__a[12], __u.__a[11], __u.__a[10], __u.__a[9], __u.__a[8], __u.__a[7], __u.__a[6], __u.__a[5], __u.__a[4], __u.__a[3], __u.__a[2], __u.__a[1], __u.__a[0]);
}
static __inline void __attribute__((__always_inline__)) simd_print_float16v32 (float16v32 a) { simd_fprint_float16v32 (_slave_stdout, a); }
static __inline void __attribute__((__always_inline__)) simd_print_float16v32_X (float16v32 a) { simd_fprint_float16v32_X (_slave_stdout, a); }

static __inline float16v32 __attribute__((__always_inline__))
simd_vaddh (float16v32 __A, float16v32 __B)
{
 return (float16v32)(__A + __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vsubh (float16v32 __A, float16v32 __B)
{
 return (float16v32)(__A - __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vmulh (float16v32 __A, float16v32 __B)
{
 return (float16v32)(__A * __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vmah (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (__A*__B+__C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vmsh (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (__A*__B-__C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vnmah (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (-__A*__B+__C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vnmsh (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (-__A*__B-__C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vinsh (_Float16 __A, float16v32 __B, const int __C)
{
        return (float16v32)__builtin_sw_slave_vinsh(__A, __B, __C);
}

static __inline _Float16 __attribute__((__always_inline__))
simd_vexth (float16v32 __A, const int __B)
{
        return (_Float16)__builtin_sw_slave_vexth(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vcpysh (float16v32 __A, float16v32 __B)
{
        return (float16v32)__builtin_sw_slave_vcpysh(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vcpysnh (float16v32 __A, float16v32 __B)
{
        return (float16v32)__builtin_sw_slave_vcpysnh(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vcpyseh (float16v32 __A, float16v32 __B)
{
        return (float16v32)__builtin_sw_slave_vcpyseh(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vfcmpeqh (float16v32 __A, float16v32 __B)
{
        return (float16v32)(__A == __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vfcmpleh (float16v32 __A, float16v32 __B)
{
        return (float16v32)(__A <= __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vfcmplth (float16v32 __A, float16v32 __B)
{
        return (float16v32)(__A < __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vfcmpunh (float16v32 __A, float16v32 __B)
{
        return (float16v32)__builtin_sw_slave_vfcmpunh(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vseleqh (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (float16v32)__builtin_sw_slave_vseleqh(__A, __B, __C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vselleh (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (float16v32)__builtin_sw_slave_vselleh(__A, __B, __C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vsellth (float16v32 __A, float16v32 __B, float16v32 __C)
{
        return (float16v32)__builtin_sw_slave_vsellth(__A, __B, __C);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmpeqw (intv16 __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vcmpeqw(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmpeqwi (intv16 __A, const int __B)
{
        return (intv16)__builtin_sw_slave_vcmpeqwi(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmplew (intv16 __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vcmplew(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmplewi (intv16 __A, const int __B)
{
        return (intv16)__builtin_sw_slave_vcmplewi(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmpltw (intv16 __A, intv16 __B)
{
        return (intv16)__builtin_sw_slave_vcmpltw(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vcmpltwi (intv16 __A, const int __B)
{
        return (intv16)__builtin_sw_slave_vcmpltwi(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vcmpulew (uintv16 __A, uintv16 __B)
{
        return (uintv16)__builtin_sw_slave_vcmpulew(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vcmpulewi (uintv16 __A, const unsigned int __B)
{
        return (uintv16)__builtin_sw_slave_vcmpulewi(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vcmpultw (uintv16 __A, uintv16 __B)
{
        return (uintv16)__builtin_sw_slave_vcmpultw(__A, __B);
}

static __inline uintv16 __attribute__((__always_inline__))
simd_vcmpultwi (uintv16 __A, const unsigned int __B)
{
        return (uintv16)__builtin_sw_slave_vcmpultwi(__A, __B);
}

static __inline intv16 __attribute__((__always_inline__))
simd_vshfw (intv16 __A, intv16 __B, intv16 __C)
{
        return (intv16)__builtin_sw_slave_vshfw(__A, __B, __C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vshfh (float16v32 __A, float16v32 __B, intv16 __C)
{
        return (float16v32)__builtin_sw_slave_vshfh(__A, __B, __C);
}
static __inline floatv8 __attribute__((__always_inline__))
simd_vshfs (floatv8 __A, floatv8 __B, intv16 __C)
{
        return (floatv8)__builtin_sw_slave_vshfs(__A, __B, __C);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vshfd (doublev8 __A, doublev8 __B, intv16 __C)
{
        return (doublev8)__builtin_sw_slave_vshfd(__A, __B, __C);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vfcvtsh (floatv8 __A, const int __B)
{
        return (float16v32)__builtin_sw_slave_vfcvtsh(__A, __B);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vfcvths (float16v32 __A, const int __B)
{
        return (floatv8)__builtin_sw_slave_vfcvths(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vcpyh (_Float16 __A)
{
        return (float16v32)__builtin_sw_slave_vcpyh(__A);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_sminh (float16v32 __A, float16v32 __B)
{
        return (float16v32) __builtin_sw_slave_sminh(__A, __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_smaxh (float16v32 __A, float16v32 __B)
{
        return (float16v32) __builtin_sw_slave_smaxh(__A, __B);
}

static __inline _Float16 __attribute__((__always_inline__))
simd_reduc_plush (float16v32 __A)
{
        return (_Float16) __builtin_sw_slave_reduc_plush(__A);
}

static __inline _Float16 __attribute__((__always_inline__))
simd_reduc_smaxh (float16v32 __A)
{
        return (_Float16) __builtin_sw_slave_reduc_smaxh(__A);
}

static __inline _Float16 __attribute__((__always_inline__))
simd_reduc_sminh (float16v32 __A)
{
        return (_Float16) __builtin_sw_slave_reduc_sminh(__A);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vdivh (float16v32 __A, float16v32 __B)
{
 return (float16v32)(__A / __B);
}

static __inline float16v32 __attribute__((__always_inline__))
simd_vsqrth (float16v32 __x)
{
 return (float16v32) __builtin_sw_slave_vsqrth(__x);
}

static __inline floatv8 __attribute__((__always_inline__))
simd_vrsqrts (floatv8 __x)
{
 return (floatv8) __builtin_sw_slave_vrsqrts(__x);
}

static __inline doublev8 __attribute__((__always_inline__))
simd_vrsqrtd (doublev8 __x)
{
 return (doublev8) __builtin_sw_slave_vrsqrtd(__x);
}

static inline float16v32 vfcvthh(float16v32 __a)
{
 return __builtin_sw_slave_vfcvthh(__a);
}




static __inline doublev8 __attribute__((__always_inline__))
simd_vfsqrtrecd (doublev8 __X)
{
        return (doublev8) __builtin_sw_slave_vfsqrtrecd(__X);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vabsd (doublev8 __X)
{
        return (doublev8)__builtin_sw_slave_vcpysd(0,__X);
}
static __inline floatv8 __attribute__((__always_inline__))
simd_vabss (floatv8 __X)
{
        return (floatv8)__builtin_sw_slave_vcpyss(0,__X);
}
static __inline int512 __attribute__((__always_inline__))
simd_vcastdl(doublev8 __X)
{
        return (int512)__builtin_sw_slave_vcastdl(__X);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vcastld(int512 __X)
{
        return (doublev8)__builtin_sw_slave_vcastld(__X);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vallzerod(doublev8 __X)
{
        return (int)__builtin_sw_slave_vallzerod(__X);
}
static __inline doublev8 __attribute__((__always_inline__))
simd_vallzerol(int512 __X)
{
        return (int)__builtin_sw_slave_vallzerol(__X);
}


static inline void simd_convert_float16(_Float16 *dest, _Float16 *src, int num)
{
 int i;
 float16v32 vdest,vsrc;
 for(i=0;i<num/32;i++)
 {
  ({ (vsrc) = __builtin_sw_load ((&src[i*32])); (vsrc); });
  vdest=vfcvthh(vsrc);
  __builtin_sw_store (&dest[i*32], vdest);
 }
}

extern __attribute__ ((section (".ldm"))) int512 __mask,__mask1;
static inline intv16 simd_vmulw(intv16 va, intv16 vb)
{
 doublev8 a0d, a1d, bd, a0d_h, a1d_h, bd_h, r0d, r1d, r0d_h, r1d_h;
 intv16 a0, a1, a_h;
 int512 r0x, r1x, r0x_h, r1x_h;
 intv16 r0, r1, r, r0_h, r1_h;
 a_h = ((int512)va >> 32) & __mask1;
 bd_h = ((int512)vb >> 32) & __mask1;
 bd = (int512)vb & __mask1;
 a1d_h = (int512)(a_h >> 16) & __mask;
 a0d_h = (int512)a_h & __mask;
 a1d = (int512)(va >> 16) & __mask;
 a0d = (int512)va & __mask;

 r1d_h = a1d_h * bd_h;
 r0d_h = a0d_h * bd_h;
 r1d = a1d * bd;
 r0d = a0d * bd;
 r1x_h = r1d_h;
 r0x_h = r0d_h;
 r1x = r1d;
 r0x = r0d;
 r1_h = (r1x_h & __mask1) << 32;
 r0_h = (r0x_h & __mask1) << 32;
 r0 = (intv16)(r0x & __mask1) | r0_h;
 r1 = (intv16)(r1x & __mask1) | r1_h;
 r = (r1 << 16) + r0;

 return r;
}

static inline intv16 simd_vdivw(intv16 va, intv16 vb)
{
 doublev8 a0d, a1d, bd, a0d_h, a1d_h, bd_h, r0d, r1d, r0d_h, r1d_h;
 intv16 a0, a1, a_h;
 int512 r0x, r1x, r0x_h, r1x_h ,v3;
 intv16 r0, r1, r, r0_h, r1_h;
 intv16 v1,v2;
 v1 = ((int512)va >> 32) & __mask1;
 v2 = v1 >> 31 ;
 v3 = (int512)v2 << 32;
 a0d_h = ((int512)va >> 32) & __mask1 | v3;
 v1 = (int512)va & __mask1 ;
 v2 = v1 >> 31 ;
 v3 = (int512)v2 << 32;
 a0d = (int512)va & __mask1 | v3;
 v1 = ((int512)vb >> 32) & __mask1;
 v2 = v1 >> 31 ;
 v3 = (int512)v2 << 32;
 bd_h = (((int512)vb >> 32) & __mask1) | v3;
 v1 = (int512)vb & __mask1 ;
 v2 = v1 >> 31 ;
 v3 = (int512)v2 << 32;
 bd = (int512)vb & __mask1 | v3;

 r0d_h = a0d_h / bd_h;
 r0d = a0d / bd;
 r0x_h = r0d_h;
 r0x = r0d;
 r0_h = (r0x_h & __mask1) << 32;
 r0 = (intv16)(r0x & __mask1) | r0_h;
 r = r0;

 return r;
}
#pragma ccc thread_code_end
# 15 "scheduler_slave.c" 2



# 1 "helper_slave.h" 1
# 20 "helper_slave.h"

# 20 "helper_slave.h"
extern void worker_help_func();
void init_slave_buffer();


typedef struct slave_helper_item {
    volatile void *item_address;
    volatile unsigned long item_hash;
    volatile struct DataAccess *item_access;
    volatile int item_id;
} slave_helper_item;

struct slave_help_buff
{
    struct slave_helper_item base[32];
    volatile int head;
    volatile int tail;
};
# 19 "scheduler_slave.c" 2
extern 
# 19 "scheduler_slave.c" 3 4
      __attribute__ ((section (".ldm_fix"))) 
# 19 "scheduler_slave.c"
                         struct slave_help_buff slave_buffer[64];



__uncached volatile int slave_lock __attribute__((aligned(32)));
__uncached volatile int master_lock __attribute__((aligned(32)));


# 26 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 26 "scheduler_slave.c"
                  aceMesh_task *local_parent;
# 69 "scheduler_slave.c"
# 1 "emp_queue.h" 1
# 21 "emp_queue.h"
# 1 "emp_basic.h" 1
# 87 "emp_basic.h"
typedef struct EQ_queue {

    struct task * array[20480];






    unsigned size;
    unsigned head;
    unsigned tail;
} EQ_queue;
# 22 "emp_queue.h" 2
# 1420 "emp_queue.h"
struct task *mem_queue[4194304];

# 1421 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1421 "emp_queue.h"
                  unsigned mem_queue_tail = 0;




extern volatile unsigned long emp_close_master[64];

# 1427 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1427 "emp_queue.h"
                  volatile int emp_close;
struct chip_buff {
    struct task *task_push[32];
    struct task *task_pop;



    volatile int head_push;
    volatile int tail_push;
    volatile int head_pop;
    volatile int tail_pop;
    volatile int pop;
    volatile int exit;
    volatile int push;
};
struct client_buff {
    struct task *task[2];
    volatile int head;
    volatile int tail;
};
extern 
# 1447 "emp_queue.h" 3 4
      __attribute__ ((section (".ldm_fix"))) 
# 1447 "emp_queue.h"
                         int local_total_num_threads;

# 1448 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1448 "emp_queue.h"
                  int threads_num = 0;
__uncached volatile long emp_lock[8] __attribute__((aligned(32)));







# 1456 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1456 "emp_queue.h"
                  int my_role;


# 1458 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1458 "emp_queue.h"
                  struct task *buff;

# 1459 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1459 "emp_queue.h"
                  struct chip_buff task_buff[64];
# 1470 "emp_queue.h"
volatile int eq_status;
volatile uint64_t eq_ptr_slot;
# 1521 "emp_queue.h"
inline int EQ_queue_full(EQ_queue *queue)

{
# 1533 "emp_queue.h"
    return (queue->tail - queue->head) == queue->size;

}




inline int EQ_queue_empty(EQ_queue *queue)

{
# 1552 "emp_queue.h"
    return queue->tail == queue->head;

}

inline unsigned EQ_queue_length(EQ_queue *queue) { return queue->tail - queue->head; }
# 1565 "emp_queue.h"
void EQ_queue_gs_push(EQ_queue *queue, struct task *t)

{
# 1634 "emp_queue.h"
    if (!EQ_queue_full(queue)) {

        queue->array[queue->tail] = t;



        queue->tail++;
# 1653 "emp_queue.h"
    } else {

        if ((4194304 - mem_queue_tail) >= (20480 / 2)) {

            int tsize = (20480 / 2) * sizeof(struct task *);
            volatile unsigned long dma_reply = 0;
            
# 1659 "emp_queue.h" 3 4
           ({ __builtin_sw_slave_athread_dma( PE_MODE, DMA_PUT, 
# 1659 "emp_queue.h"
           mem_queue + mem_queue_tail
# 1659 "emp_queue.h" 3 4
           , 
# 1659 "emp_queue.h"
           queue->array
# 1659 "emp_queue.h" 3 4
           , 
# 1659 "emp_queue.h"
           tsize
# 1659 "emp_queue.h" 3 4
           , (void*)(
# 1659 "emp_queue.h"
           (void *)&dma_reply
# 1659 "emp_queue.h" 3 4
           ), 0, 
# 1659 "emp_queue.h"
           0
# 1659 "emp_queue.h" 3 4
           , 
# 1659 "emp_queue.h"
           0 
# 1659 "emp_queue.h" 3 4
           ); 0;})
                          
# 1660 "emp_queue.h"
                         ;
            while (dma_reply != 1)
                ;
            asm volatile("memb\n");
            mem_queue_tail += 20480 / 2;
            memcpy(queue->array, queue->array + 20480 / 2, tsize);
            queue->tail = 20480 / 2;
            queue->array[queue->tail] = t;
            queue->tail++;
        } else {
            
# 1670 "emp_queue.h" 3 4
           my_printf
# 1670 "emp_queue.h"
                 ("mem queue full!!!!!!!\n");
        }
# 1685 "emp_queue.h"
        return;
    }




}




struct task *EQ_queue_gs_pop(EQ_queue *queue)

{
# 1782 "emp_queue.h"
    if (!EQ_queue_empty(queue)) {

        queue->tail = queue->tail - 1;
        struct task *temp = queue->array[queue->tail];
# 1800 "emp_queue.h"
        return temp;
    } else {
# 1810 "emp_queue.h"
        if (mem_queue_tail >= (20480 / 2)) {
            int tsize = (20480 / 2) * sizeof(struct task *);
            volatile unsigned long dma_reply = 0;
            mem_queue_tail -= 20480 / 2;
            
# 1814 "emp_queue.h" 3 4
           ({ __builtin_sw_slave_athread_dma( 
# 1814 "emp_queue.h"
           0
# 1814 "emp_queue.h" 3 4
           , DMA_GET, 
# 1814 "emp_queue.h"
           mem_queue + mem_queue_tail
# 1814 "emp_queue.h" 3 4
           , 
# 1814 "emp_queue.h"
           queue->array
# 1814 "emp_queue.h" 3 4
           , 
# 1814 "emp_queue.h"
           tsize
# 1814 "emp_queue.h" 3 4
           , (void*)(
# 1814 "emp_queue.h"
           (void *)&dma_reply
# 1814 "emp_queue.h" 3 4
           ), 
# 1814 "emp_queue.h"
           0
# 1814 "emp_queue.h" 3 4
           , 
# 1814 "emp_queue.h"
           0
# 1814 "emp_queue.h" 3 4
           , 
# 1814 "emp_queue.h"
           0 
# 1814 "emp_queue.h" 3 4
           ); 0;})
                             
# 1815 "emp_queue.h"
                            ;
            while (dma_reply != 1)
                ;
            asm volatile("memb\n");
            queue->tail = 20480 / 2;
            queue->tail = queue->tail - 1;
            struct task *temp = queue->array[queue->tail];




            return temp;
        } else {




            return 
# 1832 "emp_queue.h" 3 4
                  ((void *)0)
# 1832 "emp_queue.h"
                      ;
        }




        return 
# 1838 "emp_queue.h" 3 4
              ((void *)0)
# 1838 "emp_queue.h"
                  ;
    }


}

void EQ_begin()
{
# 1876 "emp_queue.h"
    threads_num = local_total_num_threads;

    emp_close = 0;
    emp_close_master[_MYID] = &emp_close;


    if (_MYID == 0) {
        my_role = 0;
    }





    else {
        my_role = 2;
    }


}




inline void EQ_init_queue(EQ_queue *queue)

{
    int i, j;
    for (i = 0; i < local_total_num_threads; i++) {
        task_buff[i].head_push = 0;
        task_buff[i].tail_push = 0;
        task_buff[i].head_pop = 0;
        task_buff[i].tail_pop = 0;

        task_buff[i].pop = 0;
        task_buff[i].exit = 0;
        task_buff[i].push = 0;







    }
# 1956 "emp_queue.h"
    queue->head = 0;
    queue->tail = 0;
    queue->size = 20480;
    eq_status = 5;





}

inline void EQ_destroy_queue()
{

    ;
}
# 1980 "emp_queue.h"

# 1980 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1980 "emp_queue.h"
                  int worker_tail[4][16] = {0};

# 1981 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1981 "emp_queue.h"
                  int server_head[4][16] = {0};

# 1982 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1982 "emp_queue.h"
                  volatile int worker_pop[4][16] = {0};

# 1983 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1983 "emp_queue.h"
                  int server_pop[4][16]={0};



# 1986 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1986 "emp_queue.h"
                  unsigned long push_qu_temp=0,push_qu_time=0,judge_time=0;

# 1987 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 1987 "emp_queue.h"
                  int push_qu_times=0;





void recvtask(void *queue_ptr, int thread_id, int type)

{
# 2162 "emp_queue.h"
    struct chip_buff *self = 
# 2162 "emp_queue.h" 3 4
                            ((void *)0)
# 2162 "emp_queue.h"
                                ;
    struct chip_buff *hope = 
# 2163 "emp_queue.h" 3 4
                            ((void *)0)
# 2163 "emp_queue.h"
                                ;
    struct task *t = 
# 2164 "emp_queue.h" 3 4
                    ((void *)0)
# 2164 "emp_queue.h"
                        ;
    int local_head = 0, l_head = 0;
    int local_tail = 0;
    int i = 1;
    int op = 0;
# 2188 "emp_queue.h"
    for (i = 1; i < local_total_num_threads;) {



        self = &task_buff[i];
        local_head = self->head_push;


        if (local_head == self->tail_push) {
            i++;
            continue;
        }
        t = self->task_push[local_head];



        self->head_push = (local_head + 1) % 32;







       push_qu_temp=rtc();
        EQ_queue_gs_push(queue_ptr, t);
        push_qu_time+=rtc()-push_qu_temp;
        push_qu_times++;
# 2243 "emp_queue.h"
    }


}
# 2260 "emp_queue.h"
extern volatile unsigned long master_spawn;


void EQ_global_server()
{


    int i = 0;
# 2291 "emp_queue.h"
    EQ_queue global_cent_queue;
# 2308 "emp_queue.h"
    int exit_ls, exit_client, col_loop;




    EQ_init_queue(&global_cent_queue);



    volatile int spawn_end = 0;
    master_spawn = &spawn_end;
    int j, num = 0;
    struct chip_buff *self = 
# 2320 "emp_queue.h" 3 4
                            ((void *)0)
# 2320 "emp_queue.h"
                                ;
    struct task *t = 
# 2321 "emp_queue.h" 3 4
                    ((void *)0)
# 2321 "emp_queue.h"
                        ;
    int local_tail;
    int eq_exit = 0;
    int thread_id = 0;
    int scan_null = 0;







 unsigned long recv=0,temp_recv=0,pop=0,pop_temp=0;
 int recv_num=0,pop_num=0;
    intv16 *s_pop;
    intv16 w_pop=0;
    int512 result;
    intv16 temp_pop;
    while (1) {





        recvtask(&global_cent_queue, thread_id * 16, 1);
# 2355 "emp_queue.h"
pop_temp=rtc();
pop_num++;
# 2479 "emp_queue.h"
        for (i = 1; i < local_total_num_threads; i++) {
# 2540 "emp_queue.h"
            self = &task_buff[i];
            if (self->pop == 1) {
# 2552 "emp_queue.h"
                t = EQ_queue_gs_pop(&global_cent_queue);

                if (t != 
# 2554 "emp_queue.h" 3 4
                        ((void *)0) 
# 2554 "emp_queue.h"
                             || emp_close) {
                    self->task_pop = t;



                    self->pop = 0;

                } else {



                    recvtask(&global_cent_queue, thread_id * 16, 1);

                    t = EQ_queue_gs_pop(&global_cent_queue);
                    if (t != 
# 2568 "emp_queue.h" 3 4
                            ((void *)0) 
# 2568 "emp_queue.h"
                                 || emp_close) {
                        self->task_pop = t;



                        self->pop = 0;

                    }
                }

            }
# 2645 "emp_queue.h"
        }

pop+=rtc()-pop_temp;
# 2669 "emp_queue.h"
        if (emp_close) {
            EQ_destroy_queue();
            
# 2671 "emp_queue.h" 3 4
           my_printf
# 2671 "emp_queue.h"
                 ("exit:%d num:%d\n", eq_exit, num);
            goto gs_exit;
        }





        while (!spawn_end) {

            switch (eq_status) {
                case 5:
                    break;
# 2698 "emp_queue.h"
            case 1:

                EQ_queue_gs_push(&global_cent_queue, (struct task *)eq_ptr_slot);
                eq_status = 5;
                asm volatile("memb\n");
                break;

                case 3:




                eq_ptr_slot = (uint64_t)EQ_queue_gs_pop(&global_cent_queue);

                    asm volatile("memb\n");
                    eq_status = 5;
                    asm volatile("memb\n");
                    break;
                default:
                    break;
            }





        }
# 2875 "emp_queue.h"
    }
gs_exit:
# 2893 "emp_queue.h"
    ;
}
# 2942 "emp_queue.h"

# 2942 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 2942 "emp_queue.h"
                  unsigned long lock_time = 0, once_other_time = 0, once_while_time = 0,
                                 once_task_time = 0,lock_temp=0;

# 2944 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 2944 "emp_queue.h"
                  int lock_num=0;
void EQ_push(struct task *t)
{
# 2980 "emp_queue.h"
    struct chip_buff *self = ((unsigned long)&task_buff[_MYID] | ((unsigned long)0 << 20) | (1ULL << 45));





    int local_tail = (self->tail_push + 1) % 32;





    while (self->head_push == local_tail)
        ;


    self->task_push[self->tail_push] = t;




    self->tail_push = local_tail;
# 3022 "emp_queue.h"
}

void EQ_pop_front()
{



}

# 3030 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 3030 "emp_queue.h"
                  int pop_num = 0;

# 3031 "emp_queue.h" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 3031 "emp_queue.h"
                  unsigned long pop_l=0,l_temp=0;
struct task *EQ_pop()
{

    struct task *t;







    struct chip_buff *self;

    self = ((unsigned long)&task_buff[_MYID] | ((unsigned long)0 << 20) | (1ULL << 45));
# 3078 "emp_queue.h"
    self->pop=1;

    while(self->pop&& !emp_close);


    if(self->pop==0&& !emp_close){


        t = self->task_pop;
         self->task_pop =
# 3087 "emp_queue.h" 3 4
                        ((void *)0)
# 3087 "emp_queue.h"
                            ;






        return t;
    } else {




        return 
# 3100 "emp_queue.h" 3 4
              ((void *)0)
# 3100 "emp_queue.h"
                  ;
    }
# 3120 "emp_queue.h"
}

void EQ_exit()
{
# 3136 "emp_queue.h"
}
# 70 "scheduler_slave.c" 2
# 91 "scheduler_slave.c"
extern unsigned long close_all_threads_addr[64];
extern unsigned long is_run_addr[64];


# 94 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm"))) 
# 94 "scheduler_slave.c"
              volatile int close_all_threads;

# 95 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm"))) 
# 95 "scheduler_slave.c"
              volatile int is_run;
# 116 "scheduler_slave.c"
extern 
# 116 "scheduler_slave.c" 3 4
      __attribute__ ((section (".ldm_fix"))) 
# 116 "scheduler_slave.c"
                         int recv_num;
# 145 "scheduler_slave.c"

# 145 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 145 "scheduler_slave.c"
                  int total_tiles_num;

# 146 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 146 "scheduler_slave.c"
                  unsigned long cycle_times_start;

# 147 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 147 "scheduler_slave.c"
                  unsigned long cycle_times_end;

# 148 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 148 "scheduler_slave.c"
                  double pure_exec_times = 0.0;

# 149 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 149 "scheduler_slave.c"
                  double task_pure_exec_times = 0.0;

# 150 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 150 "scheduler_slave.c"
                  double pure_task_compute_times = 0.0;

# 151 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 151 "scheduler_slave.c"
                  double pure_task_dma_times = 0.0;

# 152 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 152 "scheduler_slave.c"
                  long pure_task_num = 0;

# 153 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 153 "scheduler_slave.c"
                  int no = 0;



# 156 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 156 "scheduler_slave.c"
                  struct aceMesh_task *tmp;
# 168 "scheduler_slave.c"
extern struct task *slave_user_execute(ci_task *self);

extern 
# 170 "scheduler_slave.c" 3 4
      __attribute__ ((section (".ldm_fix"))) 
# 170 "scheduler_slave.c"
                         int pop;
extern double all_pure_exec_time[65];
extern double all_task_pure_exec_time[65];
extern double all_pure_task_compute_time[65];
extern double all_pure_task_dma_time[65];
extern long all_pure_task_num[65];
extern int sche_num_threads;
extern int total_num_threads;

# 178 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 178 "scheduler_slave.c"
                  int local_sche_num_threads;

# 179 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 179 "scheduler_slave.c"
                  int local_total_num_threads;
# 222 "scheduler_slave.c"

# 222 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 222 "scheduler_slave.c"
                  int my_id;
# 242 "scheduler_slave.c"

# 242 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm_fix"))) 
# 242 "scheduler_slave.c"
                  struct concurrent_aceMesh_stack *my_private_queue;
# 276 "scheduler_slave.c"
extern generic_scheduler *schedulers;

char init_trace[2] = "";
# 356 "scheduler_slave.c"
int get_my_id()
{
    my_id = 
# 358 "scheduler_slave.c" 3 4
           (__v_core_info[(_CGN)][
# 358 "scheduler_slave.c"
           -1
# 358 "scheduler_slave.c" 3 4
           ==-1?_PEN:
# 358 "scheduler_slave.c"
           -1
# 358 "scheduler_slave.c" 3 4
           ].thread_id)
# 358 "scheduler_slave.c"
                             ;
    return my_id;
}

inline int get_random_stealing_destid()
{
    unsigned long seed = rtc();



    return seed % local_sche_num_threads;
}
# 1070 "scheduler_slave.c"
struct task *get_next_task()
{
    struct task *t = 
# 1072 "scheduler_slave.c" 3 4
                    ((void *)0)
# 1072 "scheduler_slave.c"
                        ;
# 1089 "scheduler_slave.c"
    t = EQ_pop();

    if (t)




    {






        return t;
    }


    int stealing_destid = get_random_stealing_destid();
    struct aceMesh_stack *dest_stealing_queue = &(schedulers[stealing_destid].private_queue);
    if (slave_try_pop(dest_stealing_queue, &t)) {

        return t;
    }







    return 
# 1120 "scheduler_slave.c" 3 4
          ((void *)0)
# 1120 "scheduler_slave.c"
              ;
}
# 1485 "scheduler_slave.c"
extern 
# 1485 "scheduler_slave.c" 3 4
      __attribute__ ((section (".ldm"))) 
# 1485 "scheduler_slave.c"
                     unsigned long handle_time;

# 1486 "scheduler_slave.c" 3 4
__attribute__ ((section (".ldm"))) 
# 1486 "scheduler_slave.c"
              unsigned long exec = 0, exec_temp = 0;
# 1497 "scheduler_slave.c"
void *worker_kernel_func()
{






    local_parent = 
# 1505 "scheduler_slave.c" 3 4
                  ((void *)0)
# 1505 "scheduler_slave.c"
                      ;
# 1518 "scheduler_slave.c"
    slave_lock = 0;
    master_lock = 0;
    struct task *t;
    my_id = _MYID;
    local_total_num_threads = total_num_threads;
    local_sche_num_threads = sche_num_threads;



    if(_MYID==7){
     init_slave_buffer();
    worker_help_func();
    }
# 1908 "scheduler_slave.c"
        EQ_begin();
        if (my_role == 2) {;
# 1918 "scheduler_slave.c"
        generic_scheduler *my_scheduler = &schedulers[my_id];



        int window = 0;
# 1931 "scheduler_slave.c"
        is_run_addr[my_id] = &is_run;
        close_all_threads_addr[my_id] = &close_all_threads;

        is_run = 0;
# 1987 "scheduler_slave.c"
    my_private_queue = &(my_scheduler->private_queue);
# 2031 "scheduler_slave.c"
                while (is_run == 0);
# 2043 "scheduler_slave.c"
                t = 
# 2043 "scheduler_slave.c" 3 4
                   ((void *)0)
# 2043 "scheduler_slave.c"
                       ;
# 2063 "scheduler_slave.c"
                while (1) {



                    while (is_run == 0 && close_all_threads == 0) {







                    }
# 2242 "scheduler_slave.c"
                        if (t == 
# 2242 "scheduler_slave.c" 3 4
                                ((void *)0)
# 2242 "scheduler_slave.c"
                                    ) {





                            t = get_next_task();






                            window++;
                            if (window == 500) window = 0;
                        }

                        if (t != 
# 2259 "scheduler_slave.c" 3 4
                                ((void *)0)
# 2259 "scheduler_slave.c"
                                    ) {
# 2343 "scheduler_slave.c"
                            struct task *old_t = t;


                            local_parent = (aceMesh_task *)t;



                            t = slave_user_execute((ci_task *)t);
# 2371 "scheduler_slave.c"
                            cycle_times_end = rtc();
                            task_pure_exec_times +=
                                (double)(cycle_times_end - cycle_times_start) / 2250000000.0;

                        } else {
# 2395 "scheduler_slave.c"
            if (window == 500 - 1 && close_all_threads) break;

                        }



                }
# 2416 "scheduler_slave.c"
                EQ_exit();
                } else if (my_role == 0) { EQ_global_server(); } else { ; };
# 2500 "scheduler_slave.c"
    return 
# 2500 "scheduler_slave.c" 3 4
          ((void *)0)
# 2500 "scheduler_slave.c"
              ;
}

inline int slave_get_affinity_id(struct task *self)
{


    return self->affinity_id;
}
# 2803 "scheduler_slave.c"
void slave_spawn_to_id(struct task *t)
{


    int destid = slave_get_affinity_id(t);
# 2825 "scheduler_slave.c"
    if (destid > -1) {



        generic_scheduler *that_scheduler = &schedulers[destid];

        if (destid == local_total_num_threads) {



            slave_push(&(that_scheduler->master_private_queue), t);




        } else {
# 2853 "scheduler_slave.c"
        EQ_push(t);
# 2863 "scheduler_slave.c"
        }

    } else if (destid == -2) {
        
# 2866 "scheduler_slave.c" 3 4
       ((void) ((
# 2866 "scheduler_slave.c"
       0
# 2866 "scheduler_slave.c" 3 4
       ) ? 0 : (__assert (
# 2866 "scheduler_slave.c"
       "0"
# 2866 "scheduler_slave.c" 3 4
       , "scheduler_slave.c", 2866, __PRETTY_FUNCTION__), 0)))
# 2866 "scheduler_slave.c"
                ;
        slave_push(my_private_queue, t);
    } else if (destid == -1) {
        
# 2869 "scheduler_slave.c" 3 4
       ((void) ((
# 2869 "scheduler_slave.c"
       0
# 2869 "scheduler_slave.c" 3 4
       ) ? 0 : (__assert (
# 2869 "scheduler_slave.c"
       "0"
# 2869 "scheduler_slave.c" 3 4
       , "scheduler_slave.c", 2869, __PRETTY_FUNCTION__), 0)))
# 2869 "scheduler_slave.c"
                ;
        slave_scheduler_enqueue(t);
    } else {
        
# 2872 "scheduler_slave.c" 3 4
       ((void) ((
# 2872 "scheduler_slave.c"
       0
# 2872 "scheduler_slave.c" 3 4
       ) ? 0 : (__assert (
# 2872 "scheduler_slave.c"
       "0"
# 2872 "scheduler_slave.c" 3 4
       , "scheduler_slave.c", 2872, __PRETTY_FUNCTION__), 0)))
# 2872 "scheduler_slave.c"
                ;
    }
}







void scheduler_enqueue(struct task *t)
{





    
# 2889 "scheduler_slave.c" 3 4
   ((void) ((
# 2889 "scheduler_slave.c"
   0
# 2889 "scheduler_slave.c" 3 4
   ) ? 0 : (__assert (
# 2889 "scheduler_slave.c"
   "0"
# 2889 "scheduler_slave.c" 3 4
   , "scheduler_slave.c", 2889, __PRETTY_FUNCTION__), 0)))
# 2889 "scheduler_slave.c"
            ;

}
